Ejemplo n.º 1
0
/**
 * Register post type
 *
 * @since 1.0
*/
function edd_wl_register_post_type()
{
    $labels = apply_filters('edd_wl_post_type_labels', array('name' => '%2$s', 'singular_name' => '%1$s', 'add_new' => __('Add New', 'edd-wish-lists'), 'add_new_item' => __('Add New %1$s', 'edd-wish-lists'), 'edit_item' => __('Edit %1$s', 'edd-wish-lists'), 'new_item' => __('New %1$s', 'edd-wish-lists'), 'all_items' => __('%2$s', 'edd-wish-lists'), 'view_item' => __('View %1$s', 'edd-wish-lists'), 'search_items' => __('Search %2$s', 'edd-wish-lists'), 'not_found' => __('No %2$s found', 'edd-wish-lists'), 'not_found_in_trash' => __('No %2$s found in Trash', 'edd-wish-lists'), 'parent_item_colon' => '', 'menu_name' => __('%2$s', 'edd-wish-lists')));
    foreach ($labels as $key => $value) {
        $labels[$key] = sprintf($value, edd_wl_get_label_singular(), edd_wl_get_label_plural());
    }
    $args = apply_filters('edd_wl_post_type_args', array('labels' => $labels, 'public' => true, 'capability_type' => 'post', 'map_meta_cap' => true, 'show_ui' => true, 'hierarchical' => false, 'query_var' => true, 'exclude_from_search' => true, 'rewrite' => false, 'supports' => array('title', 'editor'), 'show_in_menu' => 'edit.php?post_type=download'));
    register_post_type('edd_wish_list', $args);
}
Ejemplo n.º 2
0
/**
 * Messages
 *
 * @since 1.0
*/
function edd_wl_messages()
{
    $messages = array('must_login' => sprintf(__('Sorry, you must login to create a %s', 'edd-wish-lists'), edd_wl_get_label_singular(true)), 'list_updated' => sprintf(__('%s updated', 'edd-wish-lists'), edd_wl_get_label_singular()), 'list_created_guest' => sprintf(__('%s created and saved for 30 days. If you wish to keep it longer, please create an account.', 'edd-wish-lists'), edd_wl_get_label_singular()), 'list_created' => sprintf(__('%s created', 'edd-wish-lists'), edd_wl_get_label_singular()), 'list_deleted' => sprintf(__('%s deleted', 'edd-wish-lists'), edd_wl_get_label_singular()), 'no_lists' => sprintf(__('You currently have no %s', 'edd-wish-lists'), edd_wl_get_label_plural(true)), 'list_delete_confirm' => sprintf(__('You are about to delete this %s, are you sure?', 'edd-wish-lists'), edd_wl_get_label_singular(true)), 'no_downloads' => sprintf(__('Nothing here yet, how about adding some %s?', 'edd-wish-lists'), edd_get_label_plural(true)), 'lists_included' => __('This item has already been added to: ', 'edd-wish-lists'), 'modal_option_save' => __('Save', 'edd-wish-lists'), 'modal_option_close' => __('Great, I\'m done', 'edd-wish-lists'), 'modal_option_add_new' => __('Add to new', 'edd-wish-lists'), 'modal_option_add_to_existing' => __('Add to existing', 'edd-wish-lists'), 'modal_option_title' => __('Title', 'edd-wish-lists'), 'modal_delete_title' => sprintf(__('Delete %s', 'edd-wish-lists'), edd_wl_get_label_singular(true)), 'modal_button_delete_confirm' => sprintf(__('Yes, delete this %s', 'edd-wish-lists'), edd_wl_get_label_singular(true)), 'modal_share_title' => sprintf(__('Share this %s', 'edd-wish-lists'), edd_wl_get_label_singular(true)), 'modal_share_success' => __('Successfully shared', 'edd-wish-lists'), 'list_option_private' => __('Private - only viewable by you', 'edd-wish-lists'), 'list_option_public' => __('Public - viewable by anyone', 'edd-wish-lists'), 'list_title_required' => __('You need to enter a title', 'edd-wish-lists'), 'item_already_purchased' => __('Already purchased', 'edd-wish-lists'));
    return apply_filters('edd_wl_messages', $messages);
}
Ejemplo n.º 3
0
    }
    ?>
	</ul>
<?php 
}
// if private lists
?>

<?php 
/**
 * Public lists
*/
if ($public) {
    ?>
	<h3><?php 
    echo sprintf(__('Public %s', 'edd-wish-lists'), edd_wl_get_label_plural());
    ?>
</h3>
	<ul class="edd-wish-list">
	<?php 
    foreach ($public as $id) {
        ?>
		<li>
			<span class="edd-wl-item-title">
				<a href="<?php 
        echo edd_wl_get_wish_list_view_uri($id);
        ?>
" title="<?php 
        echo the_title_attribute(array('post' => $id));
        ?>
"><?php 
Ejemplo n.º 4
0
/**
 * Settings
 *
 * @since 1.0
*/
function edd_wl_settings($settings)
{
    $plugin_settings = array(array('id' => 'edd_wl_header', 'name' => '<strong>' . sprintf(__('%s', 'edd-wish-lists'), edd_wl_get_label_plural()) . '</strong>', 'type' => 'header'), array('id' => 'edd_wl_page', 'name' => sprintf(__('%s Page', 'edd-wish-lists'), edd_wl_get_label_plural()), 'desc' => '<p class="description">' . sprintf(__('Select the page where users will view their %s. This page should include the [edd_wish_lists] shortcode', 'edd-wish-lists'), edd_wl_get_label_plural(true)) . '</p>', 'type' => 'dropdown_pages'), array('id' => 'edd_wl_page_view', 'name' => sprintf(__('%s View Page', 'edd-wish-lists'), edd_wl_get_label_plural()), 'desc' => '<p class="description">' . sprintf(__('Select the page where users will view each %s. This page should include the [edd_wish_lists_view] shortcode', 'edd-wish-lists'), edd_wl_get_label_singular(true)) . '</p>', 'type' => 'dropdown_pages'), array('id' => 'edd_wl_page_edit', 'name' => sprintf(__('%s Edit Page', 'edd-wish-lists'), edd_wl_get_label_plural()), 'desc' => '<p class="description">' . sprintf(__('Select the page where users will edit a %s. This page should include the [edd_wish_lists_edit] shortcode', 'edd-wish-lists'), edd_wl_get_label_singular(true)) . '</p>', 'type' => 'dropdown_pages'), array('id' => 'edd_wl_page_create', 'name' => sprintf(__('%s Create Page', 'edd-wish-lists'), edd_wl_get_label_plural()), 'desc' => '<p class="description">' . sprintf(__('Select the page where users will create a %s. This page should include the [edd_wish_lists_create] shortcode', 'edd-wish-lists'), edd_wl_get_label_singular(true)) . '</p>', 'type' => 'dropdown_pages'), array('id' => 'edd_wl_add_to_wish_list', 'name' => sprintf(__('Add To %s Text', 'edd-wish-lists'), edd_wl_get_label_singular()), 'desc' => '<p class="description">' . sprintf(__('Enter the text you\'d like to appear for adding a %s to a %s', 'edd-wish-lists'), edd_get_label_singular(true), edd_wl_get_label_singular(true)) . '</p>', 'type' => 'text', 'std' => sprintf(__('Add to %s', 'edd-wish-lists'), edd_wl_get_label_singular(true))), array('id' => 'edd_wl_add_to_cart', 'name' => __('Add To Cart Text', 'edd-wish-lists'), 'desc' => '<p class="description">' . sprintf(__('Enter the add to cart text you\'d like to appear on the single %s page', 'edd-wish-lists'), edd_wl_get_label_singular(true)) . '</p>', 'type' => 'text', 'std' => __('Add to cart', 'edd-wish-lists')), array('id' => 'edd_wl_allow_guests', 'name' => sprintf(__('Allow Guests To Create %s', 'edd-wish-lists'), edd_wl_get_label_plural()), 'type' => 'select', 'options' => array('yes' => __('Yes', 'edd-wish-lists'), 'no' => __('No', 'edd-wish-lists')), 'std' => 'yes'), array('id' => 'edd_wl_icon', 'name' => __('Icon', 'edd-wish-lists'), 'desc' => '<p class="description">' . sprintf(__('The icon to show next to the add to %s links', 'edd-wish-lists'), edd_wl_get_label_singular(true)) . '</p>', 'type' => 'select', 'options' => apply_filters('edd_wl_icons', array('add' => __('Add', 'edd-wish-lists'), 'bookmark' => __('Bookmark', 'edd-wish-lists'), 'gift' => __('Gift', 'edd-wish-lists'), 'heart' => __('Heart', 'edd-wish-lists'), 'star' => __('Star', 'edd-wish-lists'), 'none' => __('No Icon', 'edd-wish-lists'))), 'std' => 'star'), array('id' => 'edd_wl_button_style', 'name' => __('Button Style', 'edd-wish-lists'), 'desc' => '<p class="description">' . __('Display a button or a plain text link', 'edd-wish-lists') . '</p>', 'type' => 'select', 'options' => array('plain' => __('Plain Text', 'edd-wish-lists'), 'button' => __('Button', 'edd-wish-lists')), 'std' => 'button'), array('id' => 'edd_wl_services', 'name' => __('Sharing', 'edd-wish-lists'), 'desc' => __('Select the services you\'d like users to share to', 'edd-wish-lists'), 'type' => 'multicheck', 'options' => apply_filters('edd_wl_settings_services', array('twitter' => __('Twitter', 'edd-wish-lists'), 'facebook' => __('Facebook', 'edd-wish-lists'), 'googleplus' => __('Google+', 'edd-wish-lists'), 'linkedin' => __('LinkedIn', 'edd-wish-lists'), 'email' => __('Email', 'edd-wish-lists')))));
    return array_merge($settings, $plugin_settings);
}