本文整理汇总了PHP中WP_Customize_Manager::get_control方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Customize_Manager::get_control方法的具体用法?PHP WP_Customize_Manager::get_control怎么用?PHP WP_Customize_Manager::get_control使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Customize_Manager
的用法示例。
在下文中一共展示了WP_Customize_Manager::get_control方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'))));
}
示例2: bigblank_customize_register
/**
* Implement Theme Customizer additions and adjustments.
* Static front page priority is 120, so we assign our section priorities higher
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function bigblank_customize_register($wp_customize)
{
// Add postMessage support for site title and description.
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
// 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', 'bigblank');
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
$defaults = bigblank_get_default_theme_options();
// Contact Section
$wp_customize->add_section('contact', array('title' => __('Contact Settings', 'bigblank'), 'priority' => 140));
// phone text
$wp_customize->add_setting('bigblank_theme_options[phone]', array('type' => 'option', 'default' => $defaults['phone']));
$wp_customize->add_control('bigblank_theme_options[phone]', array('label' => __('Phone Number', 'bigblank'), 'section' => 'contact', 'settings' => 'bigblank_theme_options[phone]'));
// address text
$wp_customize->add_setting('bigblank_theme_options[address]', array('type' => 'option', 'default' => $defaults['address']));
$wp_customize->add_control('bigblank_theme_options[address]', array('label' => __('Address', 'bigblank'), 'section' => 'contact', 'settings' => 'bigblank_theme_options[address]'));
// social section
$wp_customize->add_section('social', array('title' => __('Social Links', 'bigblank'), 'priority' => 150));
// twitter
$wp_customize->add_setting('bigblank_theme_options[twitter]', array('type' => 'option', 'default' => $defaults['twitter']));
$wp_customize->add_control('bigblank_theme_options[twitter]', array('label' => __('Twitter', 'bigblank'), 'section' => 'social', 'settings' => 'bigblank_theme_options[twitter]'));
// facebook
$wp_customize->add_setting('bigblank_theme_options[facebook]', array('type' => 'option', 'default' => $defaults['facebook']));
$wp_customize->add_control('bigblank_theme_options[facebook]', array('label' => __('Facebook', 'bigblank'), 'section' => 'social', 'settings' => 'bigblank_theme_options[facebook]'));
// google+
$wp_customize->add_setting('bigblank_theme_options[googleplus]', array('type' => 'option', 'default' => $defaults['googleplus']));
$wp_customize->add_control('bigblank_theme_options[googleplus]', array('label' => __('Google+', 'bigblank'), 'section' => 'social', 'settings' => 'bigblank_theme_options[googleplus]'));
// instagram
$wp_customize->add_setting('bigblank_theme_options[instagram]', array('type' => 'option', 'default' => $defaults['instagram']));
$wp_customize->add_control('bigblank_theme_options[instagram]', array('label' => __('Instagram', 'bigblank'), 'section' => 'social', 'settings' => 'bigblank_theme_options[instagram]'));
// youtube
$wp_customize->add_setting('bigblank_theme_options[youtube]', array('type' => 'option', 'default' => $defaults['youtube']));
$wp_customize->add_control('bigblank_theme_options[youtube]', array('label' => __('Youtube', 'bigblank'), 'section' => 'social', 'settings' => 'bigblank_theme_options[youtube]'));
// pinterest
$wp_customize->add_setting('bigblank_theme_options[pinterest]', array('type' => 'option', 'default' => $defaults['pinterest']));
$wp_customize->add_control('bigblank_theme_options[pinterest]', array('label' => __('Pinterest', 'bigblank'), 'section' => 'social', 'settings' => 'bigblank_theme_options[pinterest]'));
// Default Layout
$wp_customize->add_section('bigblank_layout', array('title' => __('Layout', 'bigblank'), 'priority' => 130));
$wp_customize->add_setting('bigblank_theme_options[theme_layout]', array('type' => 'option', 'default' => $defaults['theme_layout'], 'sanitize_callback' => 'sanitize_key'));
$layouts = bigblank_layouts();
$choices = array();
foreach ($layouts as $layout) {
$choices[$layout['value']] = $layout['label'];
}
$wp_customize->add_control('bigblank_theme_options[theme_layout]', array('section' => 'bigblank_layout', 'type' => 'radio', 'choices' => $choices));
// Footer Section
$wp_customize->add_section('footer', array('title' => __('Footer Settings', 'bigblank'), 'priority' => 160));
// copyright text
$wp_customize->add_setting('bigblank_theme_options[footer_copyright]', array('type' => 'option', 'default' => $defaults['footer_copyright']));
$wp_customize->add_control('bigblank_theme_options[footer_copyright]', array('label' => __('Copyright Text', 'bigblank'), 'section' => 'footer', 'settings' => 'bigblank_theme_options[footer_copyright]'));
// footer text
$wp_customize->add_setting('bigblank_theme_options[footer_text]', array('type' => 'option', 'default' => $defaults['footer_text']));
$wp_customize->add_control('bigblank_theme_options[footer_text]', array('label' => __('Footer Text', 'bigblank'), 'section' => 'footer', 'settings' => 'bigblank_theme_options[footer_text]'));
}
示例3: twentyfourteen_customize_register
/**
* Implement Customizer additions and adjustments.
*
* @since Twenty Fourteen 1.0
*
* @param WP_Customize_Manager $wp_customize Customizer object.
*/
function twentyfourteen_customize_register($wp_customize)
{
// 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';
if (isset($wp_customize->selective_refresh)) {
$wp_customize->selective_refresh->add_partial('blogname', array('selector' => '.site-title a', 'container_inclusive' => false, 'render_callback' => 'twentyfourteen_customize_partial_blogname'));
$wp_customize->selective_refresh->add_partial('blogdescription', array('selector' => '.site-description', 'container_inclusive' => false, 'render_callback' => 'twentyfourteen_customize_partial_blogdescription'));
}
// 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', 'twentyfourteen');
// 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', 'twentyfourteen');
// Add custom description to Colors and Background controls or sections.
if (property_exists($wp_customize->get_control('background_color'), 'description')) {
$wp_customize->get_control('background_color')->description = __('May only be visible on wide screens.', 'twentyfourteen');
$wp_customize->get_control('background_image')->description = __('May only be visible on wide screens.', 'twentyfourteen');
} else {
$wp_customize->get_section('colors')->description = __('Background may only be visible on wide screens.', 'twentyfourteen');
$wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'twentyfourteen');
}
// Add the featured content section in case it's not already there.
$wp_customize->add_section('featured_content', array('title' => __('Featured Content', 'twentyfourteen'), '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.', 'twentyfourteen'), esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))), admin_url('edit.php?show_sticky=1')), 'priority' => 130, 'active_callback' => 'is_front_page'));
// Add the featured content layout setting and control.
$wp_customize->add_setting('featured_content_layout', array('default' => 'grid', 'sanitize_callback' => 'twentyfourteen_sanitize_layout'));
$wp_customize->add_control('featured_content_layout', array('label' => __('Layout', 'twentyfourteen'), 'section' => 'featured_content', 'type' => 'select', 'choices' => array('grid' => __('Grid', 'twentyfourteen'), 'slider' => __('Slider', 'twentyfourteen'))));
}
示例4: 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'));
}
示例5: tinyframework_customize_register
/**
* Register postMessage support.
*
* Add postMessage support for site title and description for the Theme Customizer.
*
* @since Tiny Framework 1.0
*
* @param WP_Customize_Manager $wp_customize Customizer object.
*/
function tinyframework_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';
// 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', 'tinyframework');
// 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', 'tinyframework');
}
示例6: 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);
}
示例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 & 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'));
}
示例8: itek_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function itek_customize_register($wp_customize)
{
// Add custom description to Title, Colors and Background sections.
$wp_customize->get_section('title_tagline')->description = __('Enabling the tagline will push content section down off the header image!.', 'itek');
$wp_customize->get_section('colors')->description = __('TITLE NOTE: Default color is only applied to Site Title! Background may only be visible on wide screens.', 'itek');
$wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'itek');
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->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 & Tagline Color', 'itek');
// 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', 'itek');
$wp_customize->add_section('itek_general_options', array('title' => __('iTek General Options', 'itek'), 'description' => sprintf(__('Use the following settings to set Sitewide General options.', 'itek')), 'priority' => 31));
$wp_customize->add_section('itek_content_options', array('title' => __('iTek Content Options', 'itek'), 'description' => sprintf(__('Use the following settings to set Content Options.', 'itek')), 'priority' => 32));
// Add the featured content section in case it's not already there.
$wp_customize->add_section('itek_showcase_content', array('title' => __('iTek Showcase Options', 'itek'), 'description' => sprintf(__('Use this section for extra finer controls of your Showcase area!', 'itek')), 'priority' => 33));
$wp_customize->add_section('itek_fitvids_options', array('title' => __('iTek FitVids Options', 'itek'), 'description' => sprintf(__('Use the following settings to set fitvids script options. Options are: Enable script, Set selector (Default is .post) and set custom selector (optional) for other areas like .sidebar or a custom section!', 'itek')), 'priority' => 34));
$wp_customize->add_setting('itek_tagline_visibility', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_tagline_visibility', array('type' => 'checkbox', 'label' => __('Display Site Tagline', 'itek'), 'section' => 'title_tagline', 'priority' => 20));
$wp_customize->add_setting('itek_logo_image', array('default-image' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'tanzanite_logo', array('label' => __('Upload a logo', 'itek'), 'section' => 'title_tagline', 'priority' => 21, 'settings' => 'itek_logo_image')));
$wp_customize->add_setting('itek_headerimage_visibility', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_headerimage_visibility', array('type' => 'checkbox', 'label' => __('Display Header On All Pages', 'itek'), 'section' => 'header_image', 'priority' => 1));
// Begin General Options Section
if (class_exists('woocommerce')) {
$wp_customize->add_setting('itek_woo_menu_cart_visibility', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_woo_menu_cart_visibility', array('type' => 'checkbox', 'label' => __('Add Cart Link To Primary Menu', 'itek'), 'section' => 'itek_general_options', 'priority' => 1));
$wp_customize->add_setting('itek_woo_page_title_visibility', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_woo_page_title_visibility', array('type' => 'checkbox', 'label' => __('Hide WooCommerce Page Title', 'itek'), 'section' => 'itek_general_options', 'priority' => 2));
}
$wp_customize->add_setting('itek_page_title_visibility', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_page_title_visibility', array('type' => 'checkbox', 'label' => __('Hide Standard Page Title', 'itek'), 'section' => 'itek_content_options', 'priority' => 1));
$wp_customize->add_setting('itek_feed_excerpt_length', array('sanitize_callback' => 'itek_sanitize_integer', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_feed_excerpt_length', array('type' => 'text', 'default' => '85', 'label' => __('Blog Feed Excerpt Length', 'itek'), 'section' => 'itek_content_options', 'priority' => 2));
$wp_customize->add_setting('itek_recentpost_excerpt_length', array('sanitize_callback' => 'itek_sanitize_integer', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_recentpost_excerpt_length', array('type' => 'text', 'default' => '25', 'label' => __('Recent Post Widget Excerpt Length', 'itek'), 'section' => 'itek_content_options', 'priority' => 3));
// Showcase Options
$wp_customize->add_setting('itek_showcase_disable_morphing', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_showcase_disable_morphing', array('type' => 'checkbox', 'label' => __('Disable Showcase Image Morphing', 'itek'), 'section' => 'itek_showcase_content', 'priority' => 1));
// Add FitVids to site
$wp_customize->add_setting('itek_fitvids_enable', array('sanitize_callback' => 'itek_sanitize_checkbox', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_fitvids_enable', array('type' => 'checkbox', 'label' => __('Enable FitVids?', 'itek'), 'section' => 'itek_fitvids_options', 'priority' => 1));
$wp_customize->add_setting('itek_fitvids_selector', array('default' => '.post', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_fitvids_selector', array('label' => __('Enter a selector for FitVids - i.e. .post', 'itek'), 'section' => 'itek_fitvids_options', 'priority' => 2, 'type' => 'text'));
$wp_customize->add_setting('itek_fitvids_custom_selector', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'capability' => 'edit_theme_options'));
$wp_customize->add_control('itek_fitvids_custom_selector', array('label' => __('Enter a custom selector for FitVids - i.e. .sidebar', 'itek'), 'section' => 'itek_fitvids_options', 'priority' => 3, 'type' => 'text'));
}
示例9: setControl
/**
* Handle a control entry
*
* @param $id
* @param $section_id
* @param array $data
* @throws \ErrorException If the `control_class` can not be found
*/
public function setControl($id, $section_id, array $data)
{
$control_data = $this->getControlData($id, $section_id, $data);
if (is_null($section_id) && isset($data['section'])) {
$section_id = $data['section'];
}
$item = $this->customizer->get_control($id);
if ($item) {
foreach ($data as $var => $val) {
if (array_key_exists($var, $control_data)) {
$item->{$var} = $val;
} elseif ($var == 'control_type') {
$item->type = $val;
}
}
if (!is_null($section_id)) {
$item->section = $section_id;
}
if (isset($data['delete']) && $data['delete'] === true) {
$this->customizer->remove_control($id);
}
} else {
if (!isset($data['control_type'])) {
$data['control_type'] = 'text';
}
$cls = isset($data['control_class']) ? $data['control_class'] : null;
if (is_null($cls)) {
switch ($data['control_type']) {
case 'select':
$cls = 'WP_Customize_Control';
foreach ($data['choices'] as $var => $val) {
$data['choices'][$var] = __($val, 'basicbootstrap');
}
break;
case 'checkbox':
$cls = 'WP_Customize_Control';
if (!isset($data['sanitize_callback'])) {
$data['sanitize_callback'] = 'sanitize_checkbox';
}
break;
case 'color':
$cls = 'WP_Customize_Color_Control';
if (!isset($data['sanitize_callback'])) {
$data['sanitize_callback'] = 'sanitize_hex_color';
}
break;
default:
$cls = 'WP_Customize_Control';
break;
}
}
if (!class_exists($cls)) {
throw new ErrorException(sprintf('Customizer control class "%s" not found!', $cls));
}
$this->customizer->add_control(new $cls($this->customizer, $id, $control_data));
}
}
示例10: customize_register_background
/**
* Registers the icon background setting in the Customizer. It is shown right below the Site Icon setting.
*
* @since 0.1.0
* @param WP_Customize_Manager $wp_customize action argument passed by WordPress
*/
public function customize_register_background($wp_customize)
{
$site_icon_control = $wp_customize->get_control('site_icon');
if (!$site_icon_control) {
return;
}
$wp_customize->add_setting('wpsie_background_color', array('type' => 'option', 'capability' => 'manage_options', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'wpsie_background_color', array('label' => __('Site Icon Background Color', 'site-icon-extended'), 'description' => __('The background color for the site icon is used across several Microsoft devices.', 'site-icon-extended'), 'section' => $site_icon_control->section, 'priority' => $site_icon_control->priority + 1)));
}
示例11: padhang_customize_register
/**
* Add new controls and postMessage support for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function padhang_customize_register($wp_customize)
{
// require cusom customizer controls
require_once get_template_directory() . '/inc/customizer-controls.php';
// Rename Background Image section to Background
$wp_customize->get_section('background_image')->title = __('Background', 'padhang');
// Move Background Color to Background section
$wp_customize->get_control('background_color')->section = 'background_image';
/**
* General section
*/
$wp_customize->add_section('padhang_general_section', array('title' => __('General', 'padhang'), 'priority' => 10));
$wp_customize->add_setting('fonts_kit', array('default' => 'roboto', 'sanitize_callback' => 'padhang_sanitize_fontskit'));
$wp_customize->add_control('fonts_kit', array('label' => __('Fonts Kit', 'padhang'), 'section' => 'padhang_general_section', 'settings' => 'fonts_kit', 'type' => 'select', 'choices' => array('roboto' => 'Roboto + Roboto Slab', 'opensans' => 'Open Sans + Bitter')));
$wp_customize->add_setting('wrapper_width', array('default' => '96', 'sanitize_callback' => 'padhang_wrapper_width_sanitize'));
$wp_customize->add_control('wrapper_width', array('label' => __('Wrapper width (%)', 'padhang'), 'section' => 'padhang_general_section', 'settings' => 'wrapper_width', 'type' => 'text'));
$wp_customize->add_setting('footer_text', array('default' => '© 2014 <a href="' . esc_url(home_url('/')) . '">' . bloginfo('name') . '</a>', 'sanitize_callback' => 'wp_kses_data'));
$wp_customize->add_control(new Padhang_Customize_Textarea_Control($wp_customize, 'footer_text', array('label' => __('Footer text', 'padhang'), 'section' => 'padhang_general_section', 'settings' => 'footer_text')));
/**
* Title and Tagline section
*/
$wp_customize->add_control(new Padhang_Customize_Misc_Control($wp_customize, 'options_heading', array('section' => 'title_tagline', 'type' => 'heading', 'label' => __('Title and Tagline Options', 'padhang'))));
$wp_customize->add_setting('show_hide_title', array('default' => 1, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('show_hide_title', array('label' => __('Show site title', 'padhang'), 'section' => 'title_tagline', 'settings' => 'show_hide_title', 'type' => 'checkbox'));
$wp_customize->add_setting('show_hide_tagline', array('default' => 1, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('show_hide_tagline', array('label' => __('Show site tagline', 'padhang'), 'section' => 'title_tagline', 'settings' => 'show_hide_tagline', 'type' => 'checkbox'));
/**
* Logo section
*/
$wp_customize->add_section('padhang_logo_section', array('title' => __('Logo', 'padhang'), 'priority' => 30));
$wp_customize->add_setting('logo_image', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new Padhang_Customize_Image_Control($wp_customize, 'logo_image', array('label' => __('Logo', 'padhang'), 'section' => 'padhang_logo_section', 'settings' => 'logo_image', 'context' => 'padhang-logo-image')));
$wp_customize->add_setting('favicon_image', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new Padhang_Customize_Image_Control($wp_customize, 'favicon_image', array('label' => __('Favicon', 'padhang'), 'section' => 'padhang_logo_section', 'settings' => 'favicon_image', 'context' => 'padhang-favicon-image')));
/**
* Colors section
*/
$wp_customize->add_setting('site_title_color', array('default' => '#ffffff'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_title_color', array('label' => __('Title Color', 'padhang'), 'section' => 'colors', 'settings' => 'site_title_color')));
$wp_customize->add_setting('site_tagline_color', array('default' => '#ffffff'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_tagline_color', array('label' => __('Tagline Color', 'padhang'), 'section' => 'colors', 'settings' => 'site_tagline_color')));
$wp_customize->add_setting('accent_color', array('default' => '#65b045'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'accent_color', array('label' => __('Accent Color', 'padhang'), 'section' => 'colors', 'settings' => 'accent_color')));
$wp_customize->add_setting('overlay_color', array('default' => '#222222'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'overlay_color', array('label' => __('Overlay Color (%)', 'padhang'), 'section' => 'colors', 'settings' => 'overlay_color')));
$wp_customize->add_setting('overlay_transparency', array('default' => '70', 'sanitize_callback' => 'padhang_transparency_sanitize'));
$wp_customize->add_control('overlay_transparency', array('label' => __('Overlay Transparency', 'padhang'), 'section' => 'colors', 'settings' => 'overlay_transparency', 'type' => 'text'));
$wp_customize->add_control(new Padhang_Customize_Misc_Control($wp_customize, 'overlay_transparency_description', array('section' => 'colors', 'type' => 'text', 'description' => __('Set 0 to disable overlay.', 'padhang'))));
/**
* Background section
*/
$wp_customize->add_setting('background_cover', array('default' => 0, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('background_cover', array('label' => __('Make background image covering the page', 'padhang'), 'section' => 'background_image', 'settings' => 'background_cover', 'type' => 'checkbox'));
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
}
示例12: twentyfourteen_customize_register
/**
* Implement Theme Customizer additions and adjustments.
*
* @since Twenty Fourteen 1.0
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function twentyfourteen_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.', 'twentyfourteen');
$wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'twentyfourteen');
// 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', 'twentyfourteen');
// 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', 'twentyfourteen');
// Add the featured content section in case it's not already there.
$wp_customize->add_section('featured_content', array('title' => __('Featured Content', 'twentyfourteen'), '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.', 'twentyfourteen'), 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' => 'grid', 'sanitize_callback' => 'twentyfourteen_sanitize_layout'));
$wp_customize->add_control('featured_content_layout', array('label' => __('Layout', 'twentyfourteen'), 'section' => 'featured_content', 'type' => 'select', 'choices' => array('grid' => __('Grid', 'twentyfourteen'), 'slider' => __('Slider', 'twentyfourteen'))));
}
示例13: beryl_customize_register
/**
* Implement Theme Customizer additions and adjustments.
*
* @since Beryl 1.0
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function beryl_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.', 'beryl');
$wp_customize->get_section('background_image')->description = __('Background may only be visible on wide screens.', 'beryl');
// 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', 'beryl');
// 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', 'beryl');
$wp_customize->get_section('header_image')->title = __('Logo', 'beryl');
// Social links
$wp_customize->add_section(new beryl_Customized_Section($wp_customize, 'beryl_social_links', array('priority' => 300, 'capability' => 'edit_theme_options')));
$wp_customize->add_setting('beryl_fake_field', array('sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('beryl_fake_field', array('label' => '', 'section' => 'beryl_social_links', 'type' => 'text'));
}
示例14: 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);
}
}
示例15: cover_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function cover_customize_register($wp_customize)
{
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
$wp_customize->add_setting('cover_header_color', array('default' => '#026ed2', 'sanitize_callback' => 'sanitize_hex_color'));
$wp_customize->add_setting('cover_link_color', array('default' => '#026ed2', 'sanitize_callback' => 'sanitize_hex_color'));
$wp_customize->add_setting('cover_overlay_color', array('default' => 'overlay-dark', 'sanitize_callback' => 'cover_sanitize_overlay_color'));
$wp_customize->add_setting('cover_show_featured_image', array('default' => false, 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_setting('cover_list_style', array('default' => 'minimal', 'sanitize_callback' => 'cover_sanitize_list_style'));
$wp_customize->add_setting('cover_number_of_columns', array('default' => 1, 'sanitize_callback' => 'cover_sanitize_number_of_columns'));
$wp_customize->add_section('cover_section_view', array('title' => __('Cover View Options', 'cover')));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'cover_header_color', array('label' => __('Header Color', 'cover'), 'section' => 'colors', 'settings' => 'cover_header_color')));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'cover_link_color', array('label' => __('Link Color', 'cover'), 'section' => 'colors', 'settings' => 'cover_link_color')));
$wp_customize->add_control('cover_overlay_color', array('type' => 'select', 'label' => __('Overlay Color', 'cover'), 'section' => 'colors', 'choices' => array('overlay-dark' => 'Dark', 'overlay-light' => 'Light')));
$wp_customize->add_control('cover_list_style', array('type' => 'select', 'label' => __('Post Listing Style', 'cover'), 'section' => 'cover_section_view', 'choices' => array('minimal' => 'Minimal', 'grid' => 'Card')));
$wp_customize->add_control('cover_number_of_columns', array('type' => 'select', 'label' => __('Columns', 'cover'), 'description' => 'Applied when Cover View Options -> Post Listing Style is set to Grid.', 'section' => 'cover_section_view', 'choices' => array(1 => '1', 2 => '2', 3 => '3')));
$wp_customize->add_control('cover_show_featured_image', array('type' => 'checkbox', 'label' => __('Show Featured Image', 'cover'), 'section' => 'cover_section_view'));
$wp_customize->get_control('background_color')->description = __('Applied when Cover View Options -> Post Listing Style is set to Grid.', 'cover');
$wp_customize->get_control('background_image')->description = __('Applied when Cover View Options -> Post Listing Style is set to Grid.', 'cover');
}