当前位置: 首页>>代码示例>>PHP>>正文


PHP WP_Customize_Manager::add_panel方法代码示例

本文整理汇总了PHP中WP_Customize_Manager::add_panel方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Customize_Manager::add_panel方法的具体用法?PHP WP_Customize_Manager::add_panel怎么用?PHP WP_Customize_Manager::add_panel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WP_Customize_Manager的用法示例。


在下文中一共展示了WP_Customize_Manager::add_panel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: theme_slug_register_customizer_panels

/**
 * Theme Options Customizer Implementation.
 *
 * Implement the Theme Customizer for Theme Settings.
 *
 * @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
 * 
 * @param WP_Customize_Manager $wp_customize Object that holds the customizer data.
 */
function theme_slug_register_customizer_panels($wp_customize)
{
    /*
     * Failsafe is safe
     */
    if (!isset($wp_customize)) {
        return;
    }
    /**
     * Add Panel for General Settings.
     * 
     * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
     * @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
     */
    $wp_customize->add_panel('theme_slug_panel_general', array('priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Name General Settings', 'theme-slug'), 'description' => __('Configure general settings for the Theme Name Theme', 'theme-slug')));
    /**
     * Add Panel for Color and Layout Settings.
     * 
     * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
     * @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
     */
    $wp_customize->add_panel('theme_slug_panel_colorslayouts', array('priority' => 11, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Name Colors and Layouts', 'theme-slug'), 'description' => __('Configure color and layout settings for the Theme Name Theme', 'theme-slug')));
    /**
     * Add Panel for Advanced Settings.
     * 
     * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
     * @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
     */
    $wp_customize->add_panel('theme_slug_panel_advanced', array('priority' => 12, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Name Advanced Settings', 'theme-slug'), 'description' => __('Configure advanced settings for the Theme Name Theme', 'theme-slug')));
}
开发者ID:reddhound,项目名称:code-examples,代码行数:39,代码来源:add-panels.php

示例2: honos_customize_register

/**
 * Implement Theme Customizer additions and adjustments.
 *
 * @since Honos 1.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function honos_customize_register($wp_customize)
{
    // Add custom description to Colors and Background sections.
    $wp_customize->get_section('colors')->description = esc_html__('Background may only be visible on wide screens.', 'honos');
    $wp_customize->get_section('background_image')->description = esc_html__('Background may only be visible on wide screens.', 'honos');
    // Add postMessage support for site title and description.
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    // Rename the label to "Site Title Color" because this only affects the site title in this theme.
    $wp_customize->get_control('header_textcolor')->label = esc_html__('Site Title Color', 'honos');
    // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
    $wp_customize->get_control('display_header_text')->label = esc_html__('Display Site Title & Tagline', 'honos');
    $wp_customize->get_section('header_image')->title = esc_html__('Logo', 'honos');
    // Add Theme Options panel and configure settings inside it
    $wp_customize->add_panel('honos_theme_options_panel', array('priority' => 260, 'capability' => 'edit_theme_options', 'title' => esc_html__('Theme Options', 'honos'), 'description' => esc_html__('You can configure your theme settings here', 'honos')));
    $wp_customize->add_section('honos_header_call_us', array('priority' => 90, 'capability' => 'edit_theme_options', 'title' => esc_html__('Header Call us', 'honos'), 'description' => esc_html__('Here you\'re able to configure your header call us link.', 'honos'), 'panel' => 'honos_theme_options_panel'));
    $wp_customize->add_setting('honos_header_call_us_text', array('default' => esc_html__('Call us:', 'honos'), 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('honos_header_call_us_text', array('label' => esc_html__('Call us text', 'honos'), 'section' => 'honos_header_call_us', 'type' => 'text'));
    $wp_customize->add_setting('honos_header_call_us_link', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('honos_header_call_us_link', array('label' => esc_html__('Call us link', 'honos'), 'section' => 'honos_header_call_us', 'type' => 'text'));
    $wp_customize->add_setting('honos_header_call_us_link_text', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('honos_header_call_us_link_text', array('label' => esc_html__('Call us link text', 'honos'), 'section' => 'honos_header_call_us', 'type' => 'text'));
    // Consult
    $wp_customize->add_section('honos_header_consult', array('priority' => 90, 'capability' => 'edit_theme_options', 'title' => esc_html__('Header Consult', 'honos'), 'description' => esc_html__('Consult text at the header.', 'honos'), 'panel' => 'honos_theme_options_panel'));
    $wp_customize->add_setting('honos_header_consult_text', array('default' => esc_html__('Request a free consultation', 'honos'), 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('honos_header_consult_text', array('label' => esc_html__('Consult text', 'honos'), 'section' => 'honos_header_consult', 'type' => 'text'));
    $wp_customize->add_setting('honos_header_consult_text_link', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('honos_header_consult_text_link', array('label' => esc_html__('Consult link', 'honos'), 'section' => 'honos_header_consult', 'type' => 'text'));
    // Footer columns
    $wp_customize->add_section('honos_footer_columns', array('priority' => 90, 'capability' => 'edit_theme_options', 'title' => esc_html__('Footer columns', 'honos'), 'description' => esc_html__('Footer column count.', 'honos'), 'panel' => 'honos_theme_options_panel'));
    $wp_customize->add_setting('honos_footer_column_count', array('default' => '4', 'sanitize_callback' => 'absint'));
    $wp_customize->add_control('honos_footer_column_count', array('label' => esc_html__('Footer columns', 'honos'), 'section' => 'honos_footer_columns', 'type' => 'select', 'choices' => array('1' => esc_html__('1 column', 'honos'), '2' => esc_html__('2 columns', 'honos'), '3' => esc_html__('3 columns', 'honos'), '4' => esc_html__('4 columns', 'honos'))));
}
开发者ID:cohhe,项目名称:honos,代码行数:41,代码来源:customizer.php

示例3: longform_customize_register

/**
 * Implement Theme Customizer additions and adjustments.
 *
 * @since Longform 1.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function longform_customize_register($wp_customize)
{
    // Add custom description to Colors and Background sections.
    $wp_customize->get_section('colors')->description = __('Background may only be visible on wide screens.', 'longform');
    $wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'longform');
    // Add postMessage support for site title and description.
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    // Rename the label to "Site Title Color" because this only affects the site title in this theme.
    $wp_customize->get_control('header_textcolor')->label = __('Site Title Color', 'longform');
    // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
    $wp_customize->get_control('display_header_text')->label = __('Display Site Title & Tagline', 'longform');
    // Add the featured content section in case it's not already there.
    $wp_customize->add_section('featured_content', array('title' => __('Featured Content', 'longform'), 'description' => sprintf(__('Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'longform'), admin_url('/edit.php?tag=featured'), admin_url('/edit.php?show_sticky=1')), 'priority' => 130));
    // Add the featured content layout setting and control.
    $wp_customize->add_setting('featured_content_layout', array('default' => 'slider', 'sanitize_callback' => 'longform_sanitize_layout'));
    $wp_customize->add_control('featured_content_layout', array('label' => __('Layout', 'longform'), 'section' => 'featured_content', 'type' => 'select', 'choices' => array('slider' => __('Slider', 'longform'))));
    // Add General setting panel and configure settings inside it
    $wp_customize->add_panel('longform_general_panel', array('priority' => 250, 'capability' => 'edit_theme_options', 'title' => __('General settings', 'longform'), 'description' => __('You can configure your general theme settings here', 'longform')));
    // Website logo
    $wp_customize->add_section('longform_general_logo', array('priority' => 10, 'capability' => 'edit_theme_options', 'title' => __('Website logo', 'longform'), 'description' => __('Please upload your logo, recommended logo size should be between 262x80', 'longform'), 'panel' => 'longform_general_panel'));
    $wp_customize->add_setting('longform_logo', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'longform_logo', array('label' => __('Website logo', 'longform'), 'section' => 'longform_general_logo', 'settings' => 'longform_logo')));
    // Copyright
    $wp_customize->add_section('longform_general_copyright', array('priority' => 20, 'capability' => 'edit_theme_options', 'title' => __('Copyright', 'longform'), 'description' => __('Please provide short copyright text which will be shown in footer.', 'longform'), 'panel' => 'longform_general_panel'));
    $wp_customize->add_setting('longform_copyright', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('longform_copyright', array('label' => 'Copyright', 'section' => 'longform_general_copyright', 'type' => 'text'));
    // Scroll to top
    $wp_customize->add_section('longform_general_scrolltotop', array('priority' => 30, 'capability' => 'edit_theme_options', 'title' => __('Scroll to top', 'longform'), 'description' => __('Do you want to enable "Scroll to Top" button?', 'longform'), 'panel' => 'longform_general_panel'));
    $wp_customize->add_setting('longform_scrolltotop', array('sanitize_callback' => 'longform_sanitize_checkbox'));
    $wp_customize->add_control('longform_scrolltotop', array('label' => 'Scroll to top', 'section' => 'longform_general_scrolltotop', 'type' => 'checkbox'));
    // Favicon
    $wp_customize->add_section('longform_general_favicon', array('priority' => 40, 'capability' => 'edit_theme_options', 'title' => __('Favicon', 'longform'), 'description' => __('Do you have favicon? You can upload it here.', 'longform'), 'panel' => 'longform_general_panel'));
    $wp_customize->add_setting('longform_favicon', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'longform_favicon', array('label' => __('Favicon', 'longform'), 'section' => 'longform_general_favicon', 'settings' => 'longform_favicon')));
    // Page layout
    $wp_customize->add_section('longform_general_layout', array('priority' => 50, 'capability' => 'edit_theme_options', 'title' => __('Layout', 'longform'), 'description' => __('Choose a layout for your theme pages. Note that a widget has to be inside widget are, or the layout won\'t change.', 'longform'), 'panel' => 'longform_general_panel'));
    $wp_customize->add_setting('longform_layout', array('default' => 'full', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('longform_layout', array('type' => 'radio', 'label' => 'Layout', 'section' => 'longform_general_layout', 'choices' => array('full' => 'Full', 'right' => 'Right')));
    // Add Stories grid setting panel and configure settings inside it
    $wp_customize->add_panel('longform_stories_panel', array('priority' => 260, 'capability' => 'edit_theme_options', 'title' => __('Stories grid', 'longform'), 'description' => __('You can configure your themes stories grid here.', 'longform')));
    // Grid tag
    $wp_customize->add_section('longform_stories_tag', array('priority' => 10, 'capability' => 'edit_theme_options', 'title' => __('Grid tag', 'longform'), 'description' => __('Please provide tag name of the posts which you want to show in "Stories grid" page.', 'longform'), 'panel' => 'longform_stories_panel'));
    $wp_customize->add_setting('longform_stories_tag', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('longform_stories_tag', array('label' => 'Grid tag', 'section' => 'longform_stories_tag', 'type' => 'text'));
    // Stories per page
    $wp_customize->add_section('longform_stories_perpage', array('priority' => 20, 'capability' => 'edit_theme_options', 'title' => __('Stories per page', 'longform'), 'description' => __('How much stories should be showed per page?', 'longform'), 'panel' => 'longform_stories_panel'));
    $wp_customize->add_setting('longform_stories_per_page', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('longform_stories_per_page', array('label' => 'Stories per page', 'section' => 'longform_stories_perpage', 'type' => 'text'));
    // Stories order
    $wp_customize->add_section('longform_stories_order', array('priority' => 20, 'capability' => 'edit_theme_options', 'title' => __('Stories order', 'longform'), 'description' => __('The order for stories page', 'longform'), 'panel' => 'longform_stories_panel'));
    $wp_customize->add_setting('longform_stories_main_order', array('default' => 'ASC', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('longform_stories_main_order', array('label' => 'Stories order', 'section' => 'longform_stories_order', 'type' => 'select', 'choices' => array('ASC' => __('Ascending', 'longform'), 'DESC' => __('Descending', 'longform'))));
    // Social links
    $wp_customize->add_section(new longform_Customized_Section($wp_customize, 'longform_social_links', array('priority' => 300, 'capability' => 'edit_theme_options')));
    $wp_customize->add_setting('longform_fake_field', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('longform_fake_field', array('label' => '', 'section' => 'longform_social_links', 'type' => 'text'));
}
开发者ID:leporelo,项目名称:longform,代码行数:66,代码来源:customizer.php

示例4: blogpost_customizer_register

/**
 * Implement Theme Customizer additions and adjustments.
 *
 * @since Blogpost 1.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function blogpost_customizer_register($wp_customize)
{
    // Add General setting panel and configure settings inside it
    $wp_customize->add_panel('blogpost_general_panel', array('priority' => 250, 'capability' => 'edit_theme_options', 'title' => __('General settings', 'blogpost-lite'), 'description' => __('You can configure your general theme settings here', 'blogpost-lite')));
    // Add 404 setting panel and configure settings inside it
    $wp_customize->add_panel('blogpost_404_panel', array('priority' => 250, 'capability' => 'edit_theme_options', 'title' => __('404 page', 'blogpost-lite'), 'description' => __('You can configure your themes 404 page settings here.', 'blogpost-lite')));
    // Website logo
    $wp_customize->add_section('blogpost_general_logo', array('priority' => 10, 'capability' => 'edit_theme_options', 'title' => __('Website logo', 'blogpost-lite'), 'description' => __('Please upload your logo, recommended logo size should be between 262x80', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_logo', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'blogpost_logo', array('label' => __('Website logo', 'blogpost-lite'), 'section' => 'blogpost_general_logo', 'settings' => 'blogpost_logo')));
    // Logo retina ready
    $wp_customize->add_setting('blogpost_logo_retina_ready', array('sanitize_callback' => 'blogpost_sanitize_checkbox'));
    $wp_customize->add_control('blogpost_logo_retina_ready', array('label' => 'Website logo is Retina ready', 'description' => 'You have to uplaod website logo which is 2x in dimensions. It will automatically scaled down for normal displays and prepared for High resolution displays.', 'section' => 'blogpost_general_logo', 'type' => 'checkbox'));
    // Page layout
    $wp_customize->add_section('blogpost_general_layout', array('priority' => 20, 'capability' => 'edit_theme_options', 'title' => __('Layout', 'blogpost-lite'), 'description' => __('Select a layout style.<br />(full, left side sidebar, right side sidebar)', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_layout', array('default' => 'full', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('blogpost_layout', array('type' => 'radio', 'label' => 'Layout', 'section' => 'blogpost_general_layout', 'choices' => array('full' => 'Full', 'right' => 'Right')));
    // Search background
    $wp_customize->add_section('blogpost_general_search_bg', array('priority' => 40, 'capability' => 'edit_theme_options', 'title' => __('Search background', 'blogpost-lite'), 'description' => __('Upload an image to use as your search background', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_search_background', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'blogpost_search_background', array('label' => __('Search background', 'blogpost-lite'), 'section' => 'blogpost_general_search_bg', 'settings' => 'blogpost_search_background')));
    // Show comments at sidebar
    $wp_customize->add_section('blogpost_general_sidebar_comments', array('priority' => 50, 'capability' => 'edit_theme_options', 'title' => __('Show comments at sidebar', 'blogpost-lite'), 'description' => __('Remove comment form bottom of the post and relocate it at sidebar.', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_sidebar_comments', array('sanitize_callback' => 'blogpost_sanitize_checkbox'));
    $wp_customize->add_control('blogpost_sidebar_comments', array('label' => 'Show comments at sidebar', 'section' => 'blogpost_general_sidebar_comments', 'type' => 'checkbox'));
    // Side menu image
    $wp_customize->add_section('blogpost_general_side_image', array('priority' => 60, 'capability' => 'edit_theme_options', 'title' => __('Side menu image', 'blogpost-lite'), 'description' => __('Upload an image to use as your side menu background', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_side_menu_img', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'blogpost_side_menu_img', array('label' => __('Side menu image', 'blogpost-lite'), 'section' => 'blogpost_general_side_image', 'settings' => 'blogpost_side_menu_img')));
    // Blog columns
    $wp_customize->add_section('blogpost_general_blog_columns', array('priority' => 70, 'capability' => 'edit_theme_options', 'title' => __('Blog columns', 'blogpost-lite'), 'description' => __('Select in how many columns will the blog posts be divided.', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_blog_columns', array('default' => '3', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('blogpost_blog_columns', array('type' => 'select', 'label' => 'Blog columns', 'section' => 'blogpost_general_blog_columns', 'choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6')));
    // Scroll to top
    $wp_customize->add_section('blogpost_general_scrolltotop', array('priority' => 100, 'capability' => 'edit_theme_options', 'title' => __('Scroll to top', 'blogpost-lite'), 'description' => __('Do you want to enable "Scroll to Top" button?', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_scrolltotop', array('sanitize_callback' => 'blogpost_sanitize_checkbox'));
    $wp_customize->add_control('blogpost_scrolltotop', array('label' => 'Scroll to top', 'section' => 'blogpost_general_scrolltotop', 'type' => 'checkbox'));
    // Featured post
    $wp_customize->add_section('blogpost_featured_post', array('priority' => 110, 'capability' => 'edit_theme_options', 'title' => __('Featured post', 'blogpost-lite'), 'description' => __('The ID of the featured post to show at the front page.', 'blogpost-lite'), 'panel' => 'blogpost_general_panel'));
    $wp_customize->add_setting('blogpost_featured_post_id', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('blogpost_featured_post_id', array('label' => 'Featured post', 'section' => 'blogpost_featured_post', 'type' => 'text'));
    // 404 page title
    $wp_customize->add_section('blogpost_404_page_title', array('priority' => 40, 'capability' => 'edit_theme_options', 'title' => __('404 Page Title', 'blogpost-lite'), 'description' => __('Set the page title that is displayed on the 404 Error Page.', 'blogpost-lite'), 'panel' => 'blogpost_404_panel'));
    $wp_customize->add_setting('blogpost_404_title', array('default' => 'This is somewhat embarrassing, isn\'t it?', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('blogpost_404_title', array('label' => '404 Page Title', 'section' => 'blogpost_404_page_title', 'type' => 'text'));
    // 404 page message
    $wp_customize->add_section('blogpost_404_page_message', array('priority' => 40, 'capability' => 'edit_theme_options', 'title' => __('404 Page Message', 'blogpost-lite'), 'description' => __('Set the message that is displayed on the 404 Error Page.', 'blogpost-lite'), 'panel' => 'blogpost_404_panel'));
    $wp_customize->add_setting('blogpost_404_message', array('default' => 'It seems we can\'t find what you\'re looking for. Perhaps searching, or one of the links below, can help.', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('blogpost_404_message', array('label' => '404 Page Title', 'section' => 'blogpost_404_page_message', 'type' => 'text'));
    // Social links
    $wp_customize->add_section(new blogpost_Customized_Section($wp_customize, 'blogpost_social_links', array('priority' => 300, 'capability' => 'edit_theme_options')));
    $wp_customize->add_setting('blogpost_fake_field', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('blogpost_fake_field', array('label' => '', 'section' => 'blogpost_social_links', 'type' => 'text'));
}
开发者ID:cohhe,项目名称:blogpost-lite,代码行数:61,代码来源:customizer.php

示例5: tesseract_customize_register

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function tesseract_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->add_panel('tesseract_general_options', array('priority' => 3, 'capability' => 'edit_theme_options', 'title' => 'General'));
    $wp_customize->add_panel('tesseract_header_options', array('priority' => 4, 'capability' => 'edit_theme_options', 'title' => 'Header Options'));
    $wp_customize->add_panel('tesseract_footer_options', array('priority' => 5, 'capability' => 'edit_theme_options', 'title' => 'Footer Options'));
    $wp_customize->add_panel('tesseract_layout', array('priority' => 7, 'capability' => 'edit_theme_options', 'title' => 'Layout Options'));
    $wp_customize->add_panel('tesseract_social', array('priority' => 8, 'capability' => 'edit_theme_options', 'title' => 'Social'));
    $wp_customize->get_section('title_tagline')->panel = 'tesseract_header_options';
    $wp_customize->get_section('title_tagline')->priority = 3;
    if ($wp_customize->get_section('static_front_page')) {
        $wp_customize->get_section('static_front_page')->panel = 'tesseract_general_options';
        $wp_customize->get_section('static_front_page')->priority = 4;
    }
    $wp_customize->get_section('background_image')->panel = 'tesseract_general_options';
    $wp_customize->get_section('background_image')->priority = 2;
    $wp_customize->get_section('colors')->panel = 'tesseract_general_options';
    $wp_customize->get_section('colors')->title = __('Background Color', 'tesseract');
    $wp_customize->get_section('colors')->priority = 1;
    $wp_customize->get_control('background_color')->label = __('Choose a background color', 'tesseract');
    $wp_customize->get_control('background_color')->description = __('(This is only for the site\'s generic background color. You can define header and footer background colors in the Header Options and Footer Options respectively.)', 'tesseract');
    $wp_customize->remove_section('header_image');
    $wp_customize->remove_section('nav');
    $wp_customize->remove_control('header_textcolor');
    require get_template_directory() . '/inc/sections/header-colors.php';
    require get_template_directory() . '/inc/sections/header-logo.php';
    require get_template_directory() . '/inc/sections/header-size.php';
    require get_template_directory() . '/inc/sections/header-menu.php';
    require get_template_directory() . '/inc/sections/header-content.php';
    require get_template_directory() . '/inc/sections/mobile-menu.php';
    require get_template_directory() . '/inc/sections/social/account01.php';
    require get_template_directory() . '/inc/sections/social/account02.php';
    require get_template_directory() . '/inc/sections/social/account03.php';
    require get_template_directory() . '/inc/sections/social/account04.php';
    require get_template_directory() . '/inc/sections/social/account05.php';
    require get_template_directory() . '/inc/sections/social/account06.php';
    require get_template_directory() . '/inc/sections/social/account07.php';
    require get_template_directory() . '/inc/sections/social/account08.php';
    require get_template_directory() . '/inc/sections/social/account09.php';
    require get_template_directory() . '/inc/sections/social/account10.php';
    require get_template_directory() . '/inc/sections/blog.php';
    require get_template_directory() . '/inc/sections/search-results.php';
    require get_template_directory() . '/inc/sections/footer-colors.php';
    require get_template_directory() . '/inc/sections/footer-size.php';
    require get_template_directory() . '/inc/sections/footer-logo.php';
    require get_template_directory() . '/inc/sections/footer-content.php';
    require get_template_directory() . '/inc/sections/woocommerce.php';
    //if ( $wp_customize->is_preview() && ! is_admin() )
    //add_action( 'wp_footer', 'tesseract_customize_preview', 21);
}
开发者ID:noc107,项目名称:Web-Capreso,代码行数:57,代码来源:customizer.php

示例6: sgwindow_customize_register

/**
 * Register postMessage support for site title and description for the Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Customizer object.
 * @since SG Window 1.0.0
 */
function sgwindow_customize_register($wp_customize)
{
    $wp_customize->add_panel('background', array('priority' => 105, 'title' => __('Customize Background', 'sg-window'), 'description' => __('Background.', 'sg-window')));
    $wp_customize->add_panel('navigation', array('priority' => 106, 'title' => __('Customize Menu', 'sg-window'), 'description' => __('Navigation settings.', 'sg-window')));
    //Sets postMessage support
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->get_section('colors')->panel = 'custom_colors';
    $wp_customize->get_section('colors')->priority = '1';
    $wp_customize->get_section('background_image')->panel = 'background';
    $wp_customize->get_section('background_image')->priority = '10';
    $wp_customize->get_section('background_image')->priority = '10';
}
开发者ID:a-i-ko93,项目名称:ipl-foodblog,代码行数:20,代码来源:customize.php

示例7: boron_customize_register

/**
 * Implement Theme Customizer additions and adjustments.
 *
 * @since Boron 1.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function boron_customize_register($wp_customize)
{
    // Add custom description to Colors and Background sections.
    $wp_customize->get_section('colors')->description = __('Background may only be visible on wide screens.', 'boron');
    $wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'boron');
    // Add postMessage support for site title and description.
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    // Rename the label to "Site Title Color" because this only affects the site title in this theme.
    $wp_customize->get_control('header_textcolor')->label = __('Site Title Color', 'boron');
    // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
    $wp_customize->get_control('display_header_text')->label = __('Display Site Title &amp; Tagline', 'boron');
    // Add General setting panel and configure settings inside it
    $wp_customize->add_panel('boron_general_panel', array('priority' => 250, 'capability' => 'edit_theme_options', 'title' => __('General settings', 'boron'), 'description' => __('You can configure your general theme settings here', 'boron')));
    // Add navigation setting panel and configure settings inside it
    $wp_customize->add_panel('boron_navigation_panel', array('priority' => 250, 'capability' => 'edit_theme_options', 'title' => __('Side navigation settings', 'boron'), 'description' => __('You can configure your theme side navigation settings here.', 'boron')));
    // Scroll to top
    $wp_customize->add_section('boron_general_scrolltotop', array('priority' => 30, 'capability' => 'edit_theme_options', 'title' => __('Scroll to top', 'boron'), 'description' => __('Do you want to enable "Scroll to Top" button?', 'boron'), 'panel' => 'boron_general_panel'));
    $wp_customize->add_setting('boron_scrolltotop', array('sanitize_callback' => 'boron_sanitize_checkbox'));
    $wp_customize->add_control('boron_scrolltotop', array('label' => __('Scroll to top', 'boron'), 'section' => 'boron_general_scrolltotop', 'type' => 'checkbox'));
    // Post background
    $wp_customize->add_section('boron_post_bg', array('priority' => 50, 'capability' => 'edit_theme_options', 'title' => __('Post background', 'boron'), 'description' => __('Do you want your own post background? You can change it here.', 'boron'), 'panel' => 'boron_general_panel'));
    $wp_customize->add_setting('boron_post_background', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'boron_post_background', array('label' => __('Post background', 'boron'), 'section' => 'boron_post_bg', 'settings' => 'boron_post_background')));
    // Comment position
    $wp_customize->add_section('boron_post_comments', array('priority' => 60, 'capability' => 'edit_theme_options', 'title' => __('Post comments', 'boron'), 'description' => __('Choose where to show post comments.', 'boron'), 'panel' => 'boron_general_panel'));
    $wp_customize->add_setting('boron_comment_location', array('default' => 'side', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('boron_comment_location', array('label' => __('Post comments position', 'boron'), 'section' => 'boron_post_comments', 'type' => 'select', 'choices' => array('side' => 'Right side', 'bottom' => 'After post content')));
    // Grid size
    $wp_customize->add_section('boron_grid_size', array('priority' => 60, 'capability' => 'edit_theme_options', 'title' => __('Post grid size', 'boron'), 'description' => __('Choose how many columns will there be at the post grid.', 'boron'), 'panel' => 'boron_general_panel'));
    $wp_customize->add_setting('boron_grid_columns', array('default' => '4', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('boron_grid_columns', array('label' => __('Post grid size', 'boron'), 'section' => 'boron_grid_size', 'type' => 'select', 'choices' => array('2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6')));
    // Background
    $wp_customize->add_section('boron_navigation_bg', array('priority' => 10, 'capability' => 'edit_theme_options', 'title' => __('Navigation background', 'boron'), 'description' => __('Do you want your own navigation background? You can change it here.', 'boron'), 'panel' => 'boron_navigation_panel'));
    $wp_customize->add_setting('boron_navigation_background', array('sanitize_callback' => 'esc_url_raw', 'default' => get_template_directory_uri() . '/images/navigation-bg.png'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'boron_navigation_background', array('label' => __('Navigation background', 'boron'), 'section' => 'boron_navigation_bg', 'settings' => 'boron_navigation_background')));
    // Navigation title
    $wp_customize->add_section('boron_navigation_title', array('priority' => 30, 'capability' => 'edit_theme_options', 'title' => __('Navigation title', 'boron'), 'description' => __('Title for the side navigation.', 'boron'), 'panel' => 'boron_navigation_panel'));
    $wp_customize->add_setting('boron_nav_title', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('boron_nav_title', array('label' => __('Navigation title', 'boron'), 'section' => 'boron_navigation_title', 'type' => 'text'));
    // Navigation description
    $wp_customize->add_section('boron_navigation_description', array('priority' => 40, 'capability' => 'edit_theme_options', 'title' => __('Navigation description', 'boron'), 'description' => __('Description for the side navigation.', 'boron'), 'panel' => 'boron_navigation_panel'));
    $wp_customize->add_setting('boron_nav_description', array('sanitize_callback' => 'boron_sanitize_textarea'));
    $wp_customize->add_control('boron_nav_description', array('label' => __('Navigation description', 'boron'), 'section' => 'boron_navigation_description', 'type' => 'textarea'));
    // Social links
    $wp_customize->add_section(new boron_Customized_Section($wp_customize, 'boron_social_links', array('priority' => 300, 'capability' => 'edit_theme_options')));
    $wp_customize->add_setting('boron_fake_field', array('sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('boron_fake_field', array('label' => '', 'section' => 'boron_social_links', 'type' => 'text'));
}
开发者ID:cohhe,项目名称:boron,代码行数:57,代码来源:customizer.php

示例8: register

 /**
  * This hooks into 'customize_register' (available as of WP 3.4) and allows
  * you to add new sections and controls to the Theme Customize screen.
  *
  * Note: To enable instant preview, we have to actually write a bit of custom
  * javascript. See live_preview() for more.
  *
  * @see add_action('customize_register',$func)
  * @param \WP_Customize_Manager $wp_customize
  * @since blank-theme 1.0
  */
 public static function register($wp_customize)
 {
     /*==============================
             Site title & Tagline
       ===============================*/
     //Logo
     $wp_customize->add_setting('blank_theme_logo', array('default' => "", 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw'));
     $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'blank_theme_logo', array('label' => __('Choose Site Logo', 'blank-theme'), 'section' => 'title_tagline', 'settings' => 'blank_theme_logo', 'description' => __('Remove logo to display site title.', 'blank-theme'))));
     //Hide tagline
     $wp_customize->add_setting('blank_theme_hide_tagline', array('default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blank_theme_sanitize_checkboxes'));
     $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'blank_theme_hide_tagline', array('label' => __('Hide Tagline', 'blank-theme'), 'section' => 'title_tagline', 'settings' => 'blank_theme_hide_tagline', 'type' => 'checkbox')));
     /************************** GENERAL ***************************/
     $wp_customize->add_panel('blank_theme_general_panel', array('priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('General', 'blank-theme')));
     /*==============================
                 SIDEBAR POSITIONS
       ===============================*/
     $wp_customize->add_section('blank_theme_sidebar_position_section', array('title' => __('Sidebar Position', 'blank-theme'), 'capability' => 'edit_theme_options', 'description' => __('', 'blank-theme'), 'panel' => 'blank_theme_general_panel'));
     $wp_customize->add_setting('blank_theme_sidebar_position', array('default' => 'right', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blank_theme_sanitize_choices'));
     $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'blank_theme_sidebar_position', array('label' => __('Sidebar Position', 'blank-theme'), 'section' => 'blank_theme_sidebar_position_section', 'settings' => 'blank_theme_sidebar_position', 'type' => 'radio', 'choices' => array('left' => __('Left', 'blank-theme'), 'right' => __('Right', 'blank-theme')))));
     /*==============================
             Footer Copyright Text
       ===============================*/
     $wp_customize->add_section('blank_theme_copyright_text_section', array('title' => __('Copyright Text', 'blank-theme'), 'capability' => 'edit_theme_options', 'description' => __('Will override the footer copyright text', 'blank-theme'), 'panel' => 'blank_theme_general_panel'));
     //SPECIAL FONTS
     $wp_customize->add_setting('blank_theme_copyright_text', array('default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
     $wp_customize->add_control('blank_theme_copyright_text', array('label' => __('Copyright Text', 'blank-theme'), 'section' => 'blank_theme_copyright_text_section', 'settings' => 'blank_theme_copyright_text', 'type' => 'text'));
     /*==============================
                 SLIDER
       ===============================*/
     $wp_customize->add_panel('blank_theme_pannel', array('priority' => 10, 'capability' => 'edit_theme_options', 'title' => __('Slider Options', 'blank-theme'), 'description' => __('Add slider', 'blank-theme')));
     for ($i = 1; $i <= 8; $i++) {
         $wp_customize->add_section('blank_theme_section_' . $i, array('priority' => 10, 'capability' => 'edit_theme_options', 'title' => sprintf(__('Slide %s', 'blank-theme'), $i), 'description' => __('Add slide', 'blank-theme'), 'panel' => 'blank_theme_pannel'));
         $wp_customize->add_setting('blank_theme_slides[' . $i . '][title]', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options'));
         $wp_customize->add_control('blank_theme_slides[' . $i . '][title]', array('priority' => 10, 'section' => 'blank_theme_section_' . $i, 'label' => __('Title', 'blank-theme'), 'settings' => 'blank_theme_slides[' . $i . '][title]'));
         $wp_customize->add_setting('blank_theme_slides[' . $i . '][description]', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options'));
         $wp_customize->add_control('blank_theme_slides[' . $i . '][description]', array('priority' => 10, 'section' => 'blank_theme_section_' . $i, 'label' => __('Description', 'blank-theme'), 'settings' => 'blank_theme_slides[' . $i . '][description]'));
         $wp_customize->add_setting('blank_theme_slides[' . $i . '][link]', array('default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options'));
         $wp_customize->add_control('blank_theme_slides[' . $i . '][link]', array('priority' => 10, 'section' => 'blank_theme_section_' . $i, 'label' => __('Link', 'blank-theme'), 'settings' => 'blank_theme_slides[' . $i . '][link]'));
         $wp_customize->add_setting('blank_theme_slides[' . $i . '][image]', array('default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options'));
         $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'blank_theme_slides[' . $i . '][image]', array('priority' => 10, 'section' => 'blank_theme_section_' . $i, 'label' => __('Image', 'blank-theme'), 'settings' => 'blank_theme_slides[' . $i . '][image]')));
     }
     //4. We can also change built-in settings by modifying properties. For instance, let's make some stuff use live preview JS...
     $wp_customize->get_setting('blogname')->transport = 'postMessage';
     $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
     $wp_customize->get_setting('background_color')->transport = 'postMessage';
     $wp_customize->remove_control('header_image');
     //$wp_customize->remove_control('header_textcolor');
 }
开发者ID:memash,项目名称:blank-theme,代码行数:59,代码来源:class.customizer-admin.php

示例9: dpd_2015_register_panels

/**
 * Registers custom panels for the Customizer
 *
 * @see			add_action( 'customize_register', $func )
 * @param 		WP_Customize_Manager 		$wp_customize 		Theme Customizer object.
 * @link 		http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
 * @since 		1.0.0
 */
function dpd_2015_register_panels($wp_customize)
{
    // Theme Options Panel
    $wp_customize->add_panel('theme_options', array('capability' => 'edit_theme_options', 'description' => esc_html__('Options for DPD 2015', 'dpd-2015'), 'priority' => 10, 'theme_supports' => '', 'title' => esc_html__('Theme Options', 'dpd-2015')));
    // Programs Menu Panel
    /*$wp_customize->add_panel( 'programs_menu',
    		array(
    			'capability'  		=> 'edit_theme_options',
    			'description'  		=> esc_html__( 'Links to the subsites', 'dpd-2015' ),
    			'priority'  		=> 10,
    			'theme_supports'  	=> '',
    			'title'  			=> esc_html__( 'Programs Menu', 'dpd-2015' ),
    		)
    	);*/
    /*
    // Theme Options Panel
    $wp_customize->add_panel( 'theme_options',
    	array(
    		'capability'  		=> 'edit_theme_options',
    		'description'  		=> esc_html__( 'Options for DPD 2015', 'dpd-2015' ),
    		'priority'  		=> 10,
    		'theme_supports'  	=> '',
    		'title'  			=> esc_html__( 'Theme Options', 'dpd-2015' ),
    	)
    );
    */
}
开发者ID:dccmarketing,项目名称:dpd-2015,代码行数:35,代码来源:customizer.php

示例10: setPanel

 /**
  * Handle a panel entry
  *
  * @param $id
  * @param array $data
  * @param array|null $sections
  */
 public function setPanel($id, array $data, array $sections = null)
 {
     $panel_data = $this->getPanelData($data);
     if (is_null($sections) && isset($data['sections'])) {
         $sections = $data['sections'];
     }
     $item = $this->customizer->get_panel($id);
     if ($item) {
         foreach ($data as $var => $val) {
             if (array_key_exists($var, $panel_data)) {
                 $item->{$var} = $val;
             }
         }
         if (isset($data['delete']) && $data['delete'] === true) {
             $this->customizer->remove_panel($id);
         }
     } else {
         $this->customizer->add_panel(new WP_Customize_Panel($this->customizer, $id, $panel_data));
     }
     if (!is_null($sections)) {
         $sections['object'] = 'sections';
         $sections['panel'] = $id;
         $this->processData($sections);
     }
 }
开发者ID:e-picas,项目名称:wp-basic-bootstrap,代码行数:32,代码来源:WP_Basic_Bootstrap_Customizer_Abstract.php

示例11: createPanels

 /**
  * Create all panels and sections
  *
  * @param \WP_Customize_Manager $wp_customize the WP customizer
  * @return \WP_Customize_Manager
  */
 public function createPanels($wp_customize)
 {
     $data = $this->getData();
     // Move all default sections to the default panel
     $defaultPanel = $data['options']['default_panel'];
     $wp_customize->add_panel($defaultPanel['id'], array('priority' => 10, 'title' => Strings::translate($defaultPanel['title']), 'description' => ''));
     $existingSections = $wp_customize->sections();
     /** @var \WP_Customize_Section $section */
     foreach ($existingSections as $sectionId => $section) {
         if (empty($section->panel)) {
             $section->panel = $defaultPanel['id'];
         }
     }
     // Define additional panels and sections
     $panels = $data['panels'];
     $panelPriority = 1000;
     foreach ($panels as $panelProps) {
         if (isset($panelProps['title'])) {
             $panelId = 'panel-' . $panelPriority;
             $wp_customize->add_panel($panelId, array('priority' => $panelPriority, 'title' => Strings::translate($panelProps['title']), 'description' => Strings::translate($panelProps['description'])));
         } else {
             $panelId = $defaultPanel['id'];
         }
         $sectionPriority = 10;
         foreach ($panelProps['sections'] as $sectionId => $sectionProps) {
             $wp_customize->add_section($sectionId, array('panel' => $panelId, 'priority' => $sectionPriority, 'title' => Strings::translate($sectionProps['title']), 'description' => Strings::translate($sectionProps['description'])));
             $sectionPriority += 10;
         }
         $panelPriority += 10;
     }
     return $wp_customize;
 }
开发者ID:marvinlabs,项目名称:baobab,代码行数:38,代码来源:Customizer.php

示例12: customizer

 /**
  * Register Customizer routine.
  *
  * @param \WP_Customize_Manager $wp_customize Manager.
  */
 public function customizer(WP_Customize_Manager $wp_customize)
 {
     if (!isset($wp_customize->selective_refresh)) {
         return;
     }
     $wp_customize->add_panel('wpsc', array('title' => __('Store', 'wp-e-commerce'), 'description' => __('Presentational settings for your store.', 'wp-e-commerce'), 'priority' => 150));
     foreach ($this->sections as $name => $label) {
         $wp_customize->add_section($name, array('title' => $label, 'panel' => 'wpsc'));
     }
     foreach ($this->settings as $name => $settings) {
         $wp_customize->add_setting($name, $settings['setting']);
         if (isset($settings['control']['class']) && 'WP_Customize_Control' === get_parent_class($settings['control']['class'])) {
             $class = $settings['control']['class'];
             foreach ($settings['control']['settings'] as $s) {
                 $wp_customize->add_setting($s, $settings['setting']);
             }
             $wp_customize->add_control(new $class($wp_customize, $name, array('label' => $settings['control']['label'], 'section' => $settings['control']['section'], 'settings' => $settings['control']['settings'])));
         } else {
             $wp_customize->add_control($name, $settings['control']);
         }
         if (isset($settings['partial'])) {
             $wp_customize->selective_refresh->add_partial($name, $settings['partial']);
         }
     }
 }
开发者ID:benhuson,项目名称:WP-e-Commerce,代码行数:30,代码来源:wpsc-customizer.class.php

示例13: bbird_under_customize_register

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function bbird_under_customize_register($wp_customize)
{
    $wp_customize->add_panel('footer_panel', array('priority' => 120, 'capability' => 'edit_theme_options', 'title' => __('Footer', 'bbird-under')));
    $wp_customize->add_section('footer_widgets', array('title' => __('Widget options', 'bbird-under'), 'priority' => 12, 'panel' => 'footer_panel'));
    $wp_customize->add_setting('footer_widgets', array('default' => 'no', 'sanitize_callback' => 'bbird_under_sanitize_select'));
    $wp_customize->add_control('footer_widgets', array('type' => 'radio', 'label' => __('Choose the number of footer widgets', 'bbird-under'), 'section' => 'footer_widgets', 'choices' => array('no' => __('No widgets', 'bbird-under'), 'one' => __('One (Full width)', 'bbird-under'), 'two' => __('Two (One Half)', 'bbird-under'), 'three' => __('Three (One-third layout)', 'bbird-under'), 'four' => __('Four (One-fourth layout)', 'bbird-under'))));
}
开发者ID:bbirdme,项目名称:BBird-Under,代码行数:12,代码来源:customizer.php

示例14: register_ui

 /**
  * Sets up the AMP Customizer preview.
  */
 public function register_ui()
 {
     add_action('customize_controls_enqueue_scripts', array($this, 'add_customizer_scripts'));
     add_filter('customize_previewable_devices', array($this, 'force_mobile_preview'));
     $this->wp_customize->add_panel(self::PANEL_ID, array('type' => 'amp', 'title' => __('AMP', 'amp'), 'description' => sprintf(__('<a href="%s" target="_blank">The AMP Project</a> is a Google-led initiative that dramatically improves loading speeds on phones and tablets. You can use the Customizer to preview changes to your AMP template before publishing them.', 'amp'), 'https://ampproject.org')));
     do_action('amp_customizer_register_ui', $this->wp_customize);
 }
开发者ID:thenextweb,项目名称:amp-wp,代码行数:10,代码来源:class-amp-customizer.php

示例15: tesseract_customize_register

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function tesseract_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->add_panel('tesseract_general_options', array('priority' => 3, 'capability' => 'edit_theme_options', 'title' => 'General'));
    $wp_customize->add_panel('tesseract_header_options', array('priority' => 4, 'capability' => 'edit_theme_options', 'title' => 'Header Options'));
    $wp_customize->add_panel('tesseract_footer_options', array('priority' => 5, 'capability' => 'edit_theme_options', 'title' => 'Footer Options'));
    $wp_customize->add_panel('tesseract_social', array('priority' => 9999, 'capability' => 'edit_theme_options', 'title' => 'Social'));
    $wp_customize->get_section('title_tagline')->panel = 'tesseract_header_options';
    $wp_customize->get_section('title_tagline')->priority = 3;
    $wp_customize->get_section('static_front_page')->panel = 'tesseract_general_options';
    $wp_customize->get_section('static_front_page')->priority = 4;
    $wp_customize->get_section('background_image')->panel = 'tesseract_general_options';
    $wp_customize->get_section('background_image')->priority = 2;
    $wp_customize->get_section('colors')->panel = 'tesseract_general_options';
    $wp_customize->get_section('colors')->title = __('Background Color', 'tesseract');
    $wp_customize->get_section('colors')->priority = 1;
    $wp_customize->get_control('background_color')->label = __('Choose a background color', 'tesseract');
    $wp_customize->get_control('background_color')->description = __('(This is only for the site\'s generic background color. You can define header and footer background colors in the Header Options and Footer Options respectively.)', 'tesseract');
    $wp_customize->remove_section('header_image');
    $wp_customize->remove_section('nav');
    $wp_customize->remove_control('header_textcolor');
    require get_template_directory() . '/inc/sections/header-colors.php';
    require get_template_directory() . '/inc/sections/logo.php';
    require get_template_directory() . '/inc/sections/header-menu.php';
    require get_template_directory() . '/inc/sections/header-content.php';
    require get_template_directory() . '/inc/sections/social/facebook.php';
    require get_template_directory() . '/inc/sections/social/twitter.php';
    require get_template_directory() . '/inc/sections/social/googleplus.php';
    require get_template_directory() . '/inc/sections/social/linkedin.php';
    require get_template_directory() . '/inc/sections/social/youtube.php';
    require get_template_directory() . '/inc/sections/social/vimeo.php';
    require get_template_directory() . '/inc/sections/social/tumblr.php';
    require get_template_directory() . '/inc/sections/social/flickr.php';
    require get_template_directory() . '/inc/sections/social/pinterest.php';
    require get_template_directory() . '/inc/sections/social/dribbble.php';
    require get_template_directory() . '/inc/sections/footer-colors.php';
    require get_template_directory() . '/inc/sections/footer-content.php';
    if ($wp_customize->is_preview() && !is_admin()) {
        add_action('wp_footer', 'tesseract_customize_preview', 21);
    }
}
开发者ID:AhmedElmasry2015,项目名称:WordPress-Project,代码行数:48,代码来源:customizer.php


注:本文中的WP_Customize_Manager::add_panel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。