Ejemplo n.º 1
0
    function fields()
    {
        $supported_view_types = dp_supported_view_types();
        $fields = array('dp-archive-settings' => array(array('type' => 'description', 'value' => __('These settings determine how to display content on archive pages.', 'dp')), array('type' => 'checkbox', 'name' => 'dp_loop_actions_status', 'value' => true, 'title' => __('Loop Actions', 'dp'), 'label' => __('Check this to show "Loop Actions" bar', 'dp')), array('name' => 'dp_sort_types_order'), array('name' => 'dp_sort_types', 'callback' => 'dp_sort_types_settings', 'value' => dp_supported_sort_types()), array('type' => 'checkbox', 'name' => 'dp_sort_order', 'value' => true, 'title' => __('Sort Order', 'dp'), 'label' => __('Check this to show ASC/DESC order', 'dp')), array('name' => 'dp_view_types_order'), array('name' => 'dp_view_types', 'callback' => 'dp_view_types_settings', 'value' => dp_supported_view_types()), array('type' => 'checkbox', 'name' => 'dp_ajax_inline_for_list_large_view', 'value' => true, 'title' => 'Ajax Inline Video Player', 'label' => 'Check this to enble "Ajax Inline Video Player" with "List Large" view.')), 'dp-cat-featured-settings' => array(array('name' => 'dp_cat_featured', 'callback' => 'dp_cat_featured_settings'), array('name' => 'dp_cat_featured[posts_per_page]', 'value' => 15)), 'dp-custom-labels-settings' => array(array('type' => 'description', 'value' => __("These settings enable you to change the labels of WordPress built-in post type 'post', to 'Videos', or whatever you want to name it.", 'dp')), array('type' => 'checkbox', 'name' => 'dp_post_labels_status', 'title' => __('Custom Labels', 'dp'), 'label' => __('check this to enable custom labels for post type "post"?', 'dp'), 'value' => true), array('type' => 'text', 'name' => 'dp_post_labels[name]', 'title' => __('name', 'dp'), 'value' => __('Videos', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[singular_name]', 'title' => __('singular_name', 'dp'), 'value' => __('Video', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[add_new]', 'title' => __('add_new', 'dp'), 'value' => __('Add New', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[add_new_item]', 'title' => __('add_new_item', 'dp'), 'value' => __('Add New Video', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[edit_item]', 'title' => __('edit_item', 'dp'), 'value' => __('Edit Video', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[new_item]', 'title' => __('new_item', 'dp'), 'value' => __('New Video', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[all_items]', 'title' => __('all_items', 'dp'), 'value' => __('All Videos', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[view_item]', 'title' => __('view_item', 'dp'), 'value' => __('View Video', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[search_items]', 'title' => __('search_items', 'dp'), 'value' => __('Search Videos', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[not_found]', 'title' => __('not_found', 'dp'), 'value' => __('No videos found.', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[not_found_in_trash]', 'title' => __('not_found_in_trash', 'dp'), 'value' => __('No videos found in Trash.', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[menu_name]', 'title' => __('menu_name', 'dp'), 'value' => __('Videos', 'dp')), array('type' => 'text', 'name' => 'dp_post_labels[name_admin_bar]', 'title' => __('name_admin_bar', 'dp'), 'value' => __('Video', 'dp'))), 'dp-general-settings' => array(array('type' => 'select', 'name' => 'dp_logo_type', 'value' => 'image', 'options' => array('text' => 'Text Logo', 'image' => 'Image Logo'), 'title' => __('Logo Type', 'dp')), array('type' => 'upload', 'name' => 'dp_logo', 'title' => __('Image Logo', 'dp'), 'desc' => __('Upload a logo for your theme, or specify the image url of your online logo.', 'dp'), 'value' => get_template_directory_uri() . '/images/logo.png'), array('type' => 'checkbox', 'name' => 'dp_site_description', 'title' => __('Tagline', 'dp'), 'label' => __('Show site tagline?', 'dp')), array('type' => 'upload', 'name' => 'dp_favicon', 'title' => __('Favicon', 'dp'), 'desc' => __('Upload a 16px x 16px PNG/GIF image that will represent your website\'s favicon.', 'dp'), 'value' => 'http://s.wordpress.org/favicon.ico'), array('type' => 'text', 'name' => 'dp_rss_url', 'title' => __('RSS URL', 'dp'), 'desc' => sprintf(__('The default RSS url of your website is <code>%s</code>, if you want to use other feed url(e.g. feedburner), paste it to here.', 'dp'), get_bloginfo('rss2_url'))), array('type' => 'upload', 'name' => 'dp_login_logo', 'title' => __('Login Logo', 'dp'), 'desc' => __('Upload a logo for your wp-login.php page.', 'dp'), 'value' => get_template_directory_uri() . '/images/login-logo.png'), array('type' => 'custom', 'title' => __('Main Navigation', 'dp'), 'label' => __('Check this to enable footer navigation in footer area.', 'dp'), 'desc' => sprintf(__('By default, the main navigation is a list of your categories, if your want to customize it, add a menu on <a href="%s">Apperance->Menus</a> page and set this menu as "Main Navigation" in "Theme Location" box.', 'dp'), admin_url('nav-menus.php'))), array('type' => 'checkbox', 'name' => 'dp_responsive', 'value' => true, 'title' => __('Responsive', 'dp'), 'label' => __('Check this to enable responsive?', 'dp')), array('type' => 'text', 'name' => 'dp_addthis_pubid', 'value' => true, 'title' => __('AddThis PubID', 'dp'), 'desc' => __('Your AddThis Publisher Profile ID (e.g. xa-502a3a59790da5bd). This required if you want AddThis to track analytics for your site.', 'dp')), array('type' => 'checkbox', 'name' => 'dp_fb_ogtags', 'value' => true, 'title' => __('Facebook Open Graph Tags', 'dp'), 'label' => __('Check this to insert Facebook Open Graph Tags into head.', 'dp'))), 'dp-single-settings' => array(array('type' => 'text', 'name' => 'dp_related_posts', 'title' => __('Related Posts', 'dp'), 'desc' => __("How many related posts should be displayed on the single post page? If you don't want to show it leave this field blank or set to 0.", 'dp'), 'value' => 4, 'class' => 'small-text'), array('type' => 'select', 'name' => 'dp_related_posts_view', 'title' => __('Related Posts View', 'dp'), 'value' => 'grid-mini', 'options' => array('grid-mini' => $supported_view_types['grid-mini'], 'grid-small' => $supported_view_types['grid-small'], 'grid-medium' => $supported_view_types['grid-medium'])), array('type' => 'select', 'name' => 'dp_single_video_layout', 'title' => __('Single Video Layout', 'dp'), 'desc' => __('Specify a default layout for all of the video posts, and you can override this setting for individual posts in "Video Settings" panel on edit post page.', 'dp'), 'options' => array('standard' => __('Standard', 'dp'), 'full-width' => __('Full Width', 'dp')), 'value' => 'standard', 'class' => 'small-text'), array('type' => 'checkbox', 'name' => 'dp_single_video_autoplay', 'title' => __('Autoplay', 'dp'), 'label' => __('Check this to autoplay video when viewing a single video post?', 'dp'), 'value' => true, 'class' => 'small-text'), array('type' => 'text', 'name' => 'dp_info_toggle', 'title' => __('"More/Less" Toggle', 'dp'), 'desc' => __("Enter a number as less height for video detatils area, eg. 100, if you don't need this function, leave this field blank or set to 0. Note: this function is only works on single video post pages.", 'dp'), 'value' => 100, 'class' => 'small-text'), array('type' => 'checkbox', 'name' => 'dp_single_thumb', 'title' => __('Thumbnail', 'dp'), 'label' => __('Check this to show thumbnail on single posts.', 'dp'), 'value' => false, 'class' => 'small-text')), 'dp-post-likes-settings' => array(array('type' => 'checkbox', 'name' => 'dp_post_likes[login_required]', 'value' => true, 'title' => __('Login Required', 'dp'), 'label' => __('Users must be registered and logged in to like post ', 'dp')), array('type' => 'custom', 'name' => 'dp_post_likes_page', 'title' => __('Likes Page', 'dp'), 'custom' => wp_dropdown_pages(array('echo' => false, 'name' => 'dp_post_likes_page', 'selected' => get_option('dp_post_likes_page'), 'show_option_none' => __('&mdash; Select &mdash;', 'dp'))), 'desc' => sprintf(__('<p>Select a page as user\'s likes page, if the page doesn\'t exist:<br />
					1. <a href="%s">Adding a new page</a><br />
					2. Give this page a title like "My Likes".<br />
					3. Set page template as "Likes".<br />
					<br />
					The "Likes Page" is a page for display user/visitor\'s liked posts.<br />
					<strong>* Logged in:</strong> If the user is logged in, the page will display the user\'s liked posts based on the user\'s ID.<br />
					<strong>* Not Logged in:</strong> If the visitor is not logged in, the page will display the visitor\'s liked posts based on the visitor\'s IP.<br />
					<strong>* Login Required + Not Logged in:</strong> If "Login Required" and the user is not logged in, the page will display a message to remind users to register and login.<br />', 'dp'), admin_url('post-new.php?post_type=page')))), 'dp-header-settings' => array(array('type' => 'checkbox', 'name' => 'dp_header_search', 'value' => true, 'title' => __('Header Search Box', 'dp'), 'label' => __('Check this to enable search box in header area.', 'dp'))), 'dp-footer-settings' => array(array('type' => 'checkbox', 'name' => 'dp_footer_nav_status', 'value' => true, 'title' => __('Footer Navigation', 'dp'), 'label' => __('Check this to enable footer navigation in footer area.', 'dp'), 'desc' => sprintf(__('By default, the footer navigation is a list of your pages, if your want to customize it, add a menu on <a href="%s">Apperance->Menus</a> page and set this menu as "Footer Navigation" in "Theme Location" box.', 'dp'), admin_url('nav-menus.php'))), array('type' => 'checkbox', 'name' => 'dp_footbar_status', 'value' => true, 'title' => __('Footbar(Footer Widget Area)', 'dp'), 'label' => sprintf(__('Check this to enable footbar. Add widgets on <a href="%s">Appearance->Widgets</a> page', 'dp'), admin_url('widgets.php'))), array('type' => 'text', 'name' => 'dp_site_copyright', 'title' => __('Text for Copyright', 'dp'), 'value' => __('Copyright %1$s &copy; %2$s All rights reserved.', 'dp'), 'desc' => __("<code>%1&#36;s</code> is current year, <code>%2&#36;s</code> is a link with your site name.", 'dp')), array('type' => 'textarea', 'name' => 'dp_site_credits', 'title' => __('Text for Credits', 'dp'), 'value' => __('Powered by <a target="_blank" href="http://wordpress.org/">WordPress</a> & <a target="_blank" href="http://dedepress.com/themes/detube/" title="Premium Video Theme">deTube</a> by <a target="_blank" href="http://dedepress.com" title="Premium WordPress Themes">DeDePress</a>.', 'dp'), 'desc' => __('Whether WordPress or DeDePress, No attribution or backlinks are strictly required, but play the game, it\'s always nice to be credited for your site. Any form of spreading the word is always appreciated!', 'dp')), array('type' => 'checkbox', 'name' => 'dp_social_nav_status', 'value' => true, 'title' => __('Social Navigation', 'dp'), 'label' => __('Check this to enable social navigation in footer area', 'dp')), array('type' => 'text', 'name' => 'dp_social_nav_desc', 'title' => __('Navigation Description', 'dp'), 'value' => __('Follow us elsewhere', 'dp')), array('type' => 'fields', 'title' => __('Twitter Link', 'dp'), 'fields' => array(array('type' => 'checkbox', 'name' => 'dp_social_nav_links[twitter][status]', 'value' => true), array('type' => 'text', 'name' => 'dp_social_nav_links[twitter][url]', 'prepend' => __('URL:', 'dp'), 'value' => 'http://twitter.com/dedepress', 'class' => 'regular-text'), array('type' => 'text', 'name' => 'dp_social_nav_links[twitter][title]', 'prepend' => __('Title Attribute:', 'dp'), 'value' => __('Follow us on Twitter', 'dp'), 'class' => 'regular-text'))), array('type' => 'fields', 'title' => __('Facebook Link', 'dp'), 'fields' => array(array('type' => 'checkbox', 'name' => 'dp_social_nav_links[facebook][status]', 'value' => true), array('type' => 'text', 'name' => 'dp_social_nav_links[facebook][url]', 'prepend' => __('URL:', 'dp'), 'value' => 'http://facebook.com/dedepress', 'class' => 'regular-text'), array('type' => 'text', 'name' => 'dp_social_nav_links[facebook][title]', 'prepend' => __('Title Attribute:', 'dp'), 'value' => __('Become a fan on Facebook', 'dp'), 'class' => 'regular-text'))), array('type' => 'fields', 'title' => __('Google Plus Link', 'dp'), 'fields' => array(array('type' => 'checkbox', 'name' => 'dp_social_nav_links[gplus][status]', 'value' => true), array('type' => 'text', 'name' => 'dp_social_nav_links[gplus][url]', 'prepend' => __('URL:', 'dp'), 'value' => 'http://gplus.to/dedepress', 'class' => 'regular-text'), array('type' => 'text', 'name' => 'dp_social_nav_links[gplus][title]', 'prepend' => __('Title Attribute:', 'dp'), 'value' => __('Follow us on Google Plus', 'dp'), 'class' => 'regular-text'))), array('type' => 'fields', 'title' => __('RSS Link', 'dp'), 'fields' => array(array('type' => 'checkbox', 'name' => 'dp_social_nav_links[rss][status]', 'value' => true), array('type' => 'text', 'name' => 'dp_social_nav_links[rss][url]', 'prepend' => __('URL:', 'dp'), 'value' => get_bloginfo('rss2_url'), 'class' => 'regular-text'), array('type' => 'text', 'name' => 'dp_social_nav_links[rss][title]', 'prepend' => __('Title Attribute:', 'dp'), 'value' => __('Subscriber to RSS Feed', 'dp'), 'class' => 'regular-text'))), array('type' => 'fields', 'title' => __('Newsletter Link', 'dp'), 'fields' => array(array('type' => 'checkbox', 'name' => 'dp_social_nav_links[news][status]', 'value' => true), array('type' => 'text', 'name' => 'dp_social_nav_links[news][url]', 'prepend' => __('URL:', 'dp'), 'value' => 'http://dedepress.com', 'class' => 'regular-text'), array('type' => 'text', 'name' => 'dp_social_nav_links[news][title]', 'prepend' => __('Title Attribute:', 'dp'), 'value' => __('Premium WordPress Themes', 'dp'), 'class' => 'regular-text')))), 'dp-hook-settings' => array(array('type' => 'textarea', 'name' => 'dp_head_code', 'title' => __('Head Code', 'dp'), 'desc' => __('Paste any code here. It will be inserted before the <code>&lt;/head&gt;</code> tag of your theme.', 'dp')), array('type' => 'textarea', 'name' => 'dp_footer_code', 'title' => __('Footer Code', 'dp'), 'desc' => __('Paste any code here, e.g. your Google Analytics tracking code. It will be inserted before the <code>&lt;/body&gt;</code> tag of your theme.', 'dp'))), 'dp-design-settings' => array(array('type' => 'select', 'name' => 'dp_wrap_layout', 'value' => '', 'options' => array('full-wrap' => __('Full Width', 'dp'), 'boxed-wrap' => __('Boxed', 'dp')), 'title' => __('Wrap Layout', 'dp')), array('type' => 'color', 'name' => 'dp_bgcolor', 'value' => '#EEE', 'title' => __('Custom Background Color', 'dp'), 'append' => __("Default color value is #EEEEEE", 'dp')), array('type' => 'checkbox', 'name' => 'dp_bgpat', 'value' => true, 'title' => __('Background Pattern', 'dp'), 'label' => __("Check this to enable background pattern.", 'dp')), array('type' => 'select', 'name' => 'dp_preset_bgpat', 'value' => get_template_directory_uri() . '/images/bg-pattern.png', 'options' => dp_get_patterns(), 'title' => __('Preset Background Pattern', 'dp'), 'desc' => dp_preset_bgpat_preview()), array('type' => 'upload', 'name' => 'dp_custom_bgpat', 'value' => '', 'title' => __('Custom Background Pattern', 'dp'), 'desc' => __('This option will override "Preset Background Pattern" in the above.', 'dp')), array('type' => 'select', 'name' => 'dp_bgrep', 'value' => 'repeat', 'options' => array('repeat', 'repeat-x', 'repeat-y', 'no-repeat'), 'title' => __('Background Repeat', 'dp')), array('type' => 'select', 'name' => 'dp_bgatt', 'value' => 'fixed', 'options' => array('fixed', 'scroll'), 'title' => __('Background Attachment', 'dp')), array('type' => 'checkbox', 'name' => 'dp_bgfull', 'value' => false, 'title' => __('Full Page Background Image', 'dp'), 'label' => __("Check this to enable full page background image(not working below IE9).", 'dp'))));
        return $fields;
    }
Ejemplo n.º 2
0
/**
 * Get selected view types
 */
function dp_selected_view_types()
{
    $selected_types = get_option('dp_view_types');
    if (empty($selected_types)) {
        return array();
    }
    $supported_types = dp_supported_view_types();
    foreach ($selected_types as $key => $value) {
        $selected_types[$key] = $supported_types[$key];
    }
    return apply_filters('dp_selected_view_types', $selected_types);
}