本文整理汇总了PHP中WP_Customize_Manager::add_section方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Customize_Manager::add_section方法的具体用法?PHP WP_Customize_Manager::add_section怎么用?PHP WP_Customize_Manager::add_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Customize_Manager
的用法示例。
在下文中一共展示了WP_Customize_Manager::add_section方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pure_customize_register
/**
* Add postMessage support for site title and description for the Customizer.
*
* @since Pure 1.0
*
* @param WP_Customize_Manager $wp_customize Customizer object.
*/
function pure_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->add_section('pure_profile_options', array('title' => __('Profile', 'pure'), 'description' => __('Add profile here. This may be shown publicly', 'pure'), 'priority' => 25));
// 是否显示
$wp_customize->add_setting('pure_profile_show_on', array('default' => get_option('pure_profile_show_on', 'off'), 'sanitize_callback' => 'pure_sanitize_show_on'));
$wp_customize->add_control('pure_profile_show_on', array('label' => __('Front page displays', 'pure'), 'section' => 'pure_profile_options', 'type' => 'radio', 'choices' => array('on' => __('Show on', 'pure'), 'off' => __('Show off', 'pure'))));
// 邮箱
$wp_customize->add_setting('pure_profile_email', array('default' => '', 'sanitize_callback' => 'pure_sanitize_email'));
$wp_customize->add_control('pure_profile_email', array('label' => __('Email address', 'pure'), 'section' => 'pure_profile_options', 'type' => 'text'));
// 昵称
$wp_customize->add_setting('pure_profile_nickname', array('default' => '', 'sanitize_callback' => 'pure_sanitize_nohtml'));
$wp_customize->add_control('pure_profile_nickname', array('label' => __('Nickname', 'pure'), 'section' => 'pure_profile_options', 'type' => 'text'));
// 简介
$wp_customize->add_setting('pure_profile_description', array('default' => '', 'sanitize_callback' => 'pure_sanitize_nohtml'));
$wp_customize->add_control('pure_profile_description', array('label' => __('Description', 'pure'), 'section' => 'pure_profile_options', 'type' => 'textarea'));
/* copyright */
$wp_customize->add_section('pure_copyright_options', array('title' => __('Copyright', 'pure'), 'description' => __('Add copyright here. This may be shown publicly', 'pure'), 'priority' => 25));
// 备案号
$wp_customize->add_setting('pure_copyright_icp', array('default' => '', 'sanitize_callback' => 'pure_sanitize_nohtml'));
$wp_customize->add_control('pure_copyright_icp', array('label' => __('ICP Licensing', 'pure'), 'section' => 'pure_copyright_options', 'type' => 'text'));
}
示例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'))));
}
示例3: 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
* @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
* @since ProGo 0.4
*/
public static function register($wp_customize)
{
// Page Layout Settings
$wp_customize->add_section('pgb_options[layout]', array('title' => 'ProGo Layout and Options', 'priority' => 10, 'description' => ''));
$wp_customize->add_setting('pgb_options[container_width]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_container_width')));
$wp_customize->add_setting('pgb_options[bootstrap_theme]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_bootstrap_theme')));
$wp_customize->add_control('pgb_options[container_width]', array('label' => __('Page Container Width', 'pgb'), 'section' => 'pgb_options[layout]', 'settings' => 'pgb_options[container_width]', 'type' => 'select', 'choices' => array('full' => 'Full Width (100%)', '1366' => '1366px', '1240' => '1240px', '1170' => '1170px', '1080' => '1080px', '960' => '960px')));
$wp_customize->add_control('pgb_options[bootstrap_theme]', array('label' => __('Bootstrap Theme', 'pgb'), 'section' => 'pgb_options[layout]', 'settings' => 'pgb_options[bootstrap_theme]', 'type' => 'select', 'choices' => array('default' => 'Default Bootstrap', 'cerulean' => 'Cerulean', 'cosmo' => 'Cosmo', 'cyborg' => 'Cyborg', 'darkly' => 'Darkly', 'flatly' => 'Flatly', 'journal' => 'Journal', 'lumen' => 'Lumen', 'paper' => 'Paper', 'readable' => 'Readable', 'sandstone' => 'Sandstone', 'simplex' => 'Simplex', 'slate' => 'Slate', 'spacelab' => 'Spacelab', 'superhero' => 'Superhero', 'united' => 'United', 'yeti' => 'Yeti')));
// Logo Settings
$wp_customize->add_section('pgb_options[logo]', array('title' => 'Logos', 'priority' => 30, 'description' => ''));
$wp_customize->add_setting('pgb_options[logo_mobile]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_logo')));
$wp_customize->add_setting('pgb_options[logo_tablet]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_logo')));
$wp_customize->add_setting('pgb_options[logo_desktop]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_logo')));
$wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'pgb_options[logo_mobile]', array('label' => __('Navbar Icon / Mobile Logo', 'pgb'), 'section' => 'pgb_options[logo]', 'settings' => 'pgb_options[logo_mobile]', 'description' => 'Add your logo to the Bootstrap <a href="http://getbootstrap.com/components/#navbar-brand-image" target="_blank">Brand Image</a> position. Displayed on screens under 768px wide.')));
$wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'pgb_options[logo_tablet]', array('label' => __('Tablet Logo', 'pgb'), 'section' => 'pgb_options[logo]', 'settings' => 'pgb_options[logo_tablet]', 'description' => 'Tablet logo is displayed on screens 768px to 1024px wide.')));
$wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'pgb_options[logo_desktop]', array('label' => __('Desktop Logo', 'pgb'), 'section' => 'pgb_options[logo]', 'settings' => 'pgb_options[logo_desktop]', 'description' => 'Desktop Logo is displayed on screen above 1024px wide.')));
// Nav Settings
$wp_customize->add_setting('pgb_options[menu_align]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_menu_align')));
$wp_customize->add_setting('pgb_options[nav_position]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_nav_position')));
$wp_customize->add_setting('pgb_options[nav_search]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_nav_search')));
$wp_customize->add_control('pgb_options[menu_align]', array('label' => __('Main Menu Alignment', 'pgb'), 'section' => 'nav', 'settings' => 'pgb_options[menu_align]', 'type' => 'radio', 'choices' => array('right' => 'Right', 'left' => 'Left')));
$wp_customize->add_control('pgb_options[nav_position]', array('label' => __('Main Navbar Position', 'pgb'), 'section' => 'nav', 'settings' => 'pgb_options[nav_position]', 'type' => 'radio', 'choices' => array('static' => 'Static', 'fixed' => 'Fixed')));
$wp_customize->add_control('pgb_options[nav_search]', array('label' => __('Show Search in Main Navbar', 'pgb'), 'section' => 'nav', 'settings' => 'pgb_options[nav_search]', 'type' => 'checkbox', 'value' => 1, 'description' => 'Adds search field to the far right of the navbar'));
// Footer Settings
$wp_customize->add_section('pgb_options[footer]', array('title' => 'Footer', 'priority' => 130, 'description' => ''));
$wp_customize->add_setting('pgb_options[footer_show]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_footer_show')));
$wp_customize->add_setting('pgb_options[footer_columns]', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => array('ProGo_Customize', 'sanitize_footer_columns')));
$wp_customize->add_control('pgb_options[footer_show]', array('label' => __('Show Footer Widgets', 'pgb'), 'section' => 'pgb_options[footer]', 'settings' => 'pgb_options[footer_show]', 'type' => 'checkbox', 'value' => '1'));
$wp_customize->add_control('pgb_options[footer_columns]', array('label' => __('Number of Columns', 'pgb'), 'section' => 'pgb_options[footer]', 'settings' => 'pgb_options[footer_columns]', 'type' => 'select', 'choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4')));
}
示例4: 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]'));
}
示例5: zorkish_customize_register
/**
Configure custom theme options.
@param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function zorkish_customize_register($wp_customize)
{
// Improve display of title, description, and header text color during preview
// https://developer.wordpress.org/themes/advanced-topics/customizer-api/#using-postmessage-for-improved-setting-previewing
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
$wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
// Add a custom Customizer section
$wp_customize->add_section('custom_favicon', array('title' => __('Favicon'), 'description' => __('Set up your site\'s favicon.'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Create a setting + control for the site favicons setup
$wp_customize->add_setting('favicon_links', array('default' => ''));
$wp_customize->add_control('favicon_links', array('type' => 'textarea', 'priority' => 10, 'section' => 'custom_favicon', 'label' => __('Favicon Links'), 'description' => __('Add your favicon links here.'), 'input_attrs' => array('class' => 'my-custom-class-for-js', 'style' => 'border: 1px solid #900', 'placeholder' => __('Add your favicon links here.'))));
create_color_setting($wp_customize, 'header_color', 'Header Color', '#232323');
create_color_setting($wp_customize, 'footer_color', 'Footer Color', '#232323');
create_color_setting($wp_customize, 'header_byline_color', 'Byline Color', '#DDAE4F');
// Remember whether Jetpack Site Logo is present
$site_logo_active = function_exists('jetpack_the_site_logo');
// Add a section for site logo customization. This is in additions
// to whatever Jetpack might add (if installed).
$wp_customize->add_section('zorkish_logo_section', array('title' => __($site_logo_active ? 'Inner Logo' : 'Site Logo', 'zorkish'), 'priority' => 30, 'description' => $site_logo_active ? 'Specify a logo to use on inner pages' : 'Upload a logo to replace the default site name and description in the header'));
// If Jetpack isn't installed, display the custom logo uploader.
// ALSO display it if we have a 'zorkish-logo' theme mod, to handle
// the user adding a custom logo and later installing Jetpack.
if (!$site_logo_active || get_theme_mod('zorkish-logo')) {
$wp_customize->add_setting('zorkish_logo');
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'zorkish_logo', array('label' => __('Logo', 'zorkish'), 'section' => 'zorkish_logo_section', 'settings' => 'zorkish_logo')));
}
// Add a setting for the site's inner logo
$wp_customize->add_setting('zorkish_inner_logo');
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'zorkish_inner_logo', array('label' => __('Inner Logo', 'zorkish'), 'section' => 'zorkish_logo_section', 'settings' => 'zorkish_inner_logo')));
}
示例6: undiscovered_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function undiscovered_customize_register($wp_customize)
{
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
// Logo upload
$wp_customize->add_section('undiscovered_logotype', array('title' => __('Logotype', 'undiscovered'), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name in the header'));
$wp_customize->add_setting('undiscovered_options[logotype]', array('capability' => 'edit_theme_options', 'type' => 'option'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logotype', array('label' => __('Logo', 'undiscovered'), 'section' => 'undiscovered_logotype', 'settings' => 'undiscovered_options[logotype]')));
// Fonts
$wp_customize->add_section('undiscovered_fonts', array('title' => __('Fonts', 'undiscovered'), 'priority' => 30, 'description' => 'Set main website font'));
$wp_customize->add_setting('undiscovered_options[font]', array('capability' => 'edit_theme_options', 'default' => 'Rokkit', 'type' => 'option'));
$wp_customize->add_control('font', array('settings' => 'undiscovered_options[font]', 'label' => __('Fonts', 'undiscovered'), 'section' => 'undiscovered_fonts', 'type' => 'select', 'choices' => array('Rokkitt' => 'Rokkitt', 'Kameron' => 'Kameron', 'Abel' => 'Abel', 'Alice' => 'Alice', 'Andada' => 'Andada', 'Arbutus+Slab' => 'Arbutus Slab', 'Arvo' => 'Arvo', 'Brawler' => 'Brawler', 'Cambo' => 'Cambo', 'Cookie' => 'Cookie', 'Droid+Serif' => 'Droid Serif', 'Fenix' => 'Fenix', 'Judson' => 'Judson', 'Ledger' => 'Ledger', 'Libre+Baskerville' => 'Libre Baskerville', 'Lora' => 'Lora', 'Mako' => 'Mako', 'Marck+Script' => 'Marck Script', 'Maven+Pro' => 'Maven Pro', 'Neuton' => 'Neuton', 'Ovo' => 'Ovo', 'PT+Serif+Caption' => 'PT Serif Caption')));
// Colors
$wp_customize->add_section('undiscovered_colors', array('title' => __('Colors', 'undiscovered'), 'priority' => 40));
// Primary
$wp_customize->add_setting('undiscovered_options[primary_color]', array('default' => 'e83d52', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'primary_color', array('label' => __('Primary color', 'undiscovered'), 'section' => 'undiscovered_colors', 'settings' => 'undiscovered_options[primary_color]')));
// Secondary
$wp_customize->add_setting('undiscovered_options[secondary_color]', array('default' => 'be3243', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'secondary_color', array('label' => __('Secondary color', 'undiscovered'), 'section' => 'undiscovered_colors', 'settings' => 'undiscovered_options[secondary_color]')));
// Social icons
$wp_customize->add_section('undiscovered_social', array('title' => __('Social icons', 'undiscovered'), 'priority' => 30, 'description' => 'Leave blank if don\'t needed'));
$networks = get_social_networks();
foreach ($networks as $network) {
$wp_customize->add_setting('undiscovered_options[social_' . strtolower($network) . ']', array('capability' => 'edit_theme_options', 'type' => 'option'));
$wp_customize->add_control('undiscovered_options[social_' . strtolower($network) . ']', array('label' => $network, 'section' => 'undiscovered_social', 'type' => 'text'));
}
}
示例7: riiskit_theme_customizer
/**
* Implement Theme Customizer additions and adjustments.
*
* @package Riiskit
* @subpackage functions.php
* @since 1.0.0
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function riiskit_theme_customizer($wp_customize)
{
$wp_customize->remove_section('colors');
$wp_customize->remove_section('background_image');
$wp_customize->remove_section('static_front_page');
// MOBILE
// Mobile sidr.js menu on/off
$wp_customize->add_section('developer', array('title' => __('Developer', 'riiskit'), 'priority' => 2, 'description' => __('Options for the developer.', 'riiskit')));
// toggle/slideout selection
$wp_customize->add_setting('developer_menu_type', array('default' => 'toggle-menu', 'type' => 'option', 'capability' => 'activate_plugins', 'sanitize_callback', 'riiskit_sanitize_menu_type'));
$wp_customize->add_control('developer_menu_type', array('label' => __('Menutype', 'riiskit'), 'section' => 'developer', 'settings' => 'developer_menu_type', 'type' => 'select', 'choices' => array('toggle-menu' => 'Toggle', 'slideout-menu' => 'Slideout')));
// SOCIAL
$wp_customize->add_section('social', array('title' => __('Social', 'riiskit'), 'description' => __('Add links to your social profiles.', 'riiskit'), 'priority' => 135));
$social_links = array();
// Facebook
$social_links[] = array('slug' => 'social_facebook_link', 'label' => 'Facebook');
// Twitter
$social_links[] = array('slug' => 'social_twitter_link', 'label' => 'Twitter');
foreach ($social_links as $link) {
// SETTINGS
$wp_customize->add_setting($link['slug'], array('type' => 'option', 'sanitize_callback' => 'riiskit_sanitize_url'));
// CONTROLS
$wp_customize->add_control($link['slug'], array('label' => $link['label'], 'section' => 'social', 'settings' => $link['slug'], 'type' => 'text'));
}
}
示例8: everbox_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function everbox_customize_register($wp_customize)
{
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
$wp_customize->add_section('everbox_general_section', array('title' => __('General', 'everbox')));
// Primary Color
$wp_customize->add_setting('everbox_primary_color', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'everbox_sanitize_hex_color'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'everbox_primary_color', array('label' => __('Primary Color', 'everbox'), 'section' => 'everbox_general_section', 'settings' => 'everbox_primary_color')));
// Post excerpt length
$wp_customize->add_setting('everbox_excerpt_length', array('default' => 60, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'everbox_sanitize_integer'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'everbox_excerpt_length', array('label' => __('Post excerpt length', 'everbox'), 'section' => 'everbox_general_section', 'settings' => 'everbox_excerpt_length', 'type' => 'number')));
// Cagetory link
$wp_customize->add_setting('everbox_category_link', array('default' => 1, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'everbox_sanitize_bool'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'everbox_category_link', array('label' => __('Show cagetory link', 'everbox'), 'section' => 'everbox_general_section', 'settings' => 'everbox_category_link', 'type' => 'checkbox')));
// Infinite loading
$wp_customize->add_setting('everbox_infinite', array('default' => 0, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'everbox_sanitize_bool'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'everbox_infinite', array('label' => __('Infinite Pagination with jetpack', 'everbox'), 'section' => 'everbox_general_section', 'settings' => 'everbox_infinite', 'type' => 'checkbox')));
// Credit
$wp_customize->add_setting('everbox_credit', array('default' => 1, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'everbox_sanitize_bool'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'everbox_credit', array('label' => __('Footer Credit', 'everbox'), 'section' => 'everbox_general_section', 'settings' => 'everbox_credit', 'type' => 'checkbox')));
$wp_customize->add_section('everbox_icons_section', array('title' => __('ICONS', 'everbox')));
// LOGO
$wp_customize->add_setting('everbox_logo', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'everbox_logo', array('label' => __('LOGO', 'everbox'), 'section' => 'everbox_icons_section', 'settings' => 'everbox_logo')));
// favicon
$wp_customize->add_setting('everbox_favicon', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'everbox_favicon', array('label' => __('Favicon', 'everbox'), 'section' => 'everbox_icons_section', 'settings' => 'everbox_favicon')));
// iPhone App icon
$wp_customize->add_setting('everbox_app', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'everbox_app', array('label' => __('iPhone Retina icon (sizes:120x120)', 'everbox'), 'section' => 'everbox_icons_section', 'settings' => 'everbox_app')));
}
示例9: simplicize_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function simplicize_customize_register($wp_customize)
{
// Set site name and description text to be previewed in real-time
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
// Set site title color to be previewed in real-time
$wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
// Site Title Section
$wp_customize->add_section('title_tagline', array('title' => __('Site Title, Tagline & Logo', 'simplicize'), 'priority' => 1));
//Logo Uploader
$wp_customize->add_setting('simplicize_logo');
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'simplicize_logo', array('label' => __('Logo', 'simplicize'), 'section' => 'title_tagline', 'settings' => 'simplicize_logo', 'priority' => 1)));
// Site Title Align
$wp_customize->add_setting('title_align', array('default' => 'center', 'sanitize_callback' => 'simplicize_sanitize_logo_align'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'title_align', array('type' => 'radio', 'label' => __('Title & Logo Alignment', 'simplicize'), 'section' => 'title_tagline', 'choices' => array('left' => __('Left Align', 'simplicize'), 'center' => __('Center Align', 'simplicize'), 'right' => __('Right Align', 'simplicize')), 'priority' => 60)));
//Layout
$wp_customize->add_section('simplicize_layout_section', array('title' => __('Layout', 'simplicize'), 'priority' => 104));
// Display Blog Author
$wp_customize->add_setting('display_author_blog', array('default' => true, 'sanitize_callback' => 'simplicize_sanitize_checkbox'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'display_author_blog', array('label' => __('Show Blog Author Link?', 'simplicize'), 'section' => 'simplicize_layout_section', 'settings' => 'display_author_blog', 'type' => 'checkbox', 'priority' => 60)));
// Display Blog Date
$wp_customize->add_setting('display_date_blog', array('default' => true, 'sanitize_callback' => 'simplicize_sanitize_checkbox'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'display_date_blog', array('label' => __('Show Blog Date?', 'simplicize'), 'section' => 'simplicize_layout_section', 'settings' => 'display_date_blog', 'type' => 'checkbox', 'priority' => 60)));
// Display Post Featured Image or Video
$wp_customize->add_setting('display_feature_post', array('default' => true, 'sanitize_callback' => 'simplicize_sanitize_checkbox'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'display_feature_post', array('label' => __('Show Post Featured Images?', 'simplicize'), 'section' => 'simplicize_layout_section', 'settings' => 'display_feature_post', 'type' => 'checkbox', 'priority' => 80)));
}
示例10: gravit_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function gravit_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';
/* new section */
$wp_customize->add_section('gravit_footer', array('title' => __('Footer', 'gravit'), 'priority' => 999));
/* footer text */
$wp_customize->add_setting('footer_text', array('default' => 'Gravit Theme powered by WordPress', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'footer_text', array('label' => __('Footer text', 'gravit'), 'section' => 'gravit_footer')));
/* Colors extended */
$colors = array();
$colors[] = array('slug' => 'title_text_color', 'default' => '#4B4A47', 'label' => __('Site Title Text Color', 'gravit'));
$colors[] = array('slug' => 'footer_text_color', 'default' => '#808080', 'label' => __('Footer Text Color', 'gravit'));
$colors[] = array('slug' => 'footer_link_color', 'default' => '#c2c2c2', 'label' => __('Footer Link Color', 'gravit'));
$colors[] = array('slug' => 'icon_color', 'default' => '#EF3636', 'label' => __('Icon Color', 'gravit'));
$colors[] = array('slug' => 'about_page_color', 'default' => '#FFFFFF', 'label' => __('Aboute Me Page Background Color', 'gravit'));
foreach ($colors as $color) {
// SETTINGS
$wp_customize->add_setting($color['slug'], array('default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_hex_color'));
// CONTROLS
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $color['slug'], array('label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug'])));
}
$wp_customize->add_section('global_options', array('title' => 'Global Options', 'priority' => 20));
$wp_customize->add_setting('show_icons', array('default' => false, 'transport' => 'postMessage', 'sanitize_callback' => 'gravit_sanitize_checkbox'));
$wp_customize->add_control('show_icons', array('section' => 'global_options', 'label' => 'Show Post Icons?', 'type' => 'checkbox'));
$wp_customize->add_setting('remove_space', array('default' => false, 'transport' => 'postMessage', 'sanitize_callback' => 'gravit_sanitize_checkbox'));
$wp_customize->add_control('remove_space', array('section' => 'global_options', 'label' => 'Remove Space beneath header?', 'type' => 'checkbox'));
}
示例11: register
/**
* This hooks into 'customize_register' and allows you to add
* new sections and controls to the Theme Customize screen.
*/
public function register()
{
// Get filter data.
$theme_panel = apply_filters('pt-sticky-menu/theme_panel', array('panel' => 'panel_autopt', 'priority' => 31));
$settings_defaults = apply_filters('pt-sticky-menu/settings_default', array('sticky_selected' => false, 'fp_select' => 'none', 'fp_custom_text' => 'Featured Page', 'fp_cutsom_url' => '#', 'fp_new_window' => false, 'fp_icon' => 'fa-phone', 'fp_bg_color' => '#ffffff', 'logo_selected' => false, 'logo_img' => '', 'logo2x_img' => ''));
// Section.
$this->wp_customize->add_section('sticky_menu_section', array('title' => esc_html__('Sticky Menu', 'pt-sticky-menu'), 'description' => esc_html__('Settings for the sticky menu', 'pt-sticky-menu'), 'priority' => $theme_panel['priority'], 'panel' => $theme_panel['panel']));
// Settings.
$this->wp_customize->add_setting('sticky_menu_select', array('default' => $settings_defaults['sticky_selected']));
$this->wp_customize->add_setting('sticky_menu_featured_page_select', array('default' => $settings_defaults['fp_select']));
$this->wp_customize->add_setting('sticky_menu_featured_page_custom_text', array('default' => $settings_defaults['fp_custom_text']));
$this->wp_customize->add_setting('sticky_menu_featured_page_custom_url', array('default' => $settings_defaults['fp_cutsom_url']));
$this->wp_customize->add_setting('sticky_menu_featured_page_open_in_new_window', array('default' => $settings_defaults['fp_new_window']));
$this->wp_customize->add_setting('sticky_menu_featured_page_icon', array('default' => $settings_defaults['fp_icon']));
$this->wp_customize->add_setting('sticky_menu_bg_color', array('default' => $settings_defaults['fp_bg_color']));
$this->wp_customize->add_setting('sticky_logo_selected', array('default' => $settings_defaults['logo_selected']));
$this->wp_customize->add_setting('sticky_logo_img', array('default' => $settings_defaults['logo_img']));
$this->wp_customize->add_setting('sticky_logo2x_img', array('default' => $settings_defaults['logo2x_img']));
// Controls.
$this->wp_customize->add_control('sticky_menu_select', array('type' => 'checkbox', 'priority' => 10, 'label' => esc_html__('Enable sticky menu', 'pt-sticky-menu'), 'section' => 'sticky_menu_section'));
$this->wp_customize->add_control('sticky_menu_featured_page_select', array('type' => 'select', 'priority' => 20, 'label' => esc_html__('Featured page', 'pt-sticky-menu'), 'description' => esc_html__('To which page should the Call-to-action button link to?', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'choices' => Helpers::get_all_pages_id_title(), 'active_callback' => array($this, 'is_sticky_menu_selected')));
$this->wp_customize->add_control('sticky_menu_featured_page_custom_text', array('priority' => 30, 'label' => esc_html__('Custom button text', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_featured_page_custom_url')));
$this->wp_customize->add_control('sticky_menu_featured_page_custom_url', array('priority' => 40, 'label' => esc_html__('Custom URL', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_featured_page_custom_url')));
$this->wp_customize->add_control('sticky_menu_featured_page_open_in_new_window', array('type' => 'checkbox', 'priority' => 50, 'label' => esc_html__('Open link in a new window/tab?', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_featured_page_selected')));
$this->wp_customize->add_control('sticky_menu_featured_page_icon', array('priority' => 60, 'label' => esc_html__('Font Awesome icon', 'pt-sticky-menu'), 'description' => sprintf(esc_html__('Insert a %s icon. Example: fa-phone.', 'pt-sticky-menu'), '<a href="http://fontawesome.io/icons/" target="_blank">Font Awesome</a>'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_featured_page_selected')));
$this->wp_customize->add_control(new \WP_Customize_Color_Control($this->wp_customize, 'sticky_menu_bg_color', array('priority' => 70, 'label' => esc_html__('Sticky menu background color', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_sticky_menu_selected'))));
$this->wp_customize->add_control('sticky_logo_selected', array('type' => 'checkbox', 'priority' => 80, 'label' => esc_html__('Set custom logos for sticky menu?', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_sticky_menu_selected')));
$this->wp_customize->add_control(new \WP_Customize_Image_Control($this->wp_customize, 'sticky_logo_img', array('priority' => 90, 'label' => esc_html__('Logo Image', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_custom_logo_selected'))));
$this->wp_customize->add_control(new \WP_Customize_Image_Control($this->wp_customize, 'sticky_logo2x_img', array('priority' => 100, 'label' => esc_html__('Retina Logo Image', 'pt-sticky-menu'), 'description' => esc_html__('2x logo size, for screens with high DPI.', 'pt-sticky-menu'), 'section' => 'sticky_menu_section', 'active_callback' => array($this, 'is_custom_logo_selected'))));
}
示例12: graphy_customize_register
/**
* Implement Theme Customizer additions and adjustments.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function graphy_customize_register($wp_customize)
{
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
$wp_customize->add_setting('graphy_hide_blogdescription', array('default' => '', 'sanitize_callback' => 'graphy_sanitize_checkbox'));
$wp_customize->add_control('graphy_hide_blogdescription', array('label' => __('Hide Tagline', 'graphy'), 'section' => 'title_tagline', 'settings' => 'graphy_hide_blogdescription', 'type' => 'checkbox'));
$wp_customize->add_section('graphy_logo', array('title' => __('Logo', 'graphy'), 'priority' => 20));
$wp_customize->add_setting('graphy_logo', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'graphy_logo', array('label' => __('Upload Logo', 'graphy'), 'section' => 'graphy_logo', 'settings' => 'graphy_logo')));
$wp_customize->add_setting('graphy_top_margin', array('default' => '0', 'sanitize_callback' => 'graphy_sanitize_margin'));
$wp_customize->add_control('graphy_top_margin', array('label' => __('Top Margin (px)', 'graphy'), 'section' => 'graphy_logo', 'settings' => 'graphy_top_margin', 'type' => 'text'));
$wp_customize->add_setting('graphy_bottom_margin', array('default' => '0', 'sanitize_callback' => 'graphy_sanitize_margin'));
$wp_customize->add_control('graphy_bottom_margin', array('label' => __('Bottom Margin (px)', 'graphy'), 'section' => 'graphy_logo', 'settings' => 'graphy_bottom_margin', 'type' => 'text'));
$wp_customize->add_setting('graphy_replace_blogname', array('default' => '', 'sanitize_callback' => 'graphy_sanitize_checkbox'));
$wp_customize->add_control('graphy_replace_blogname', array('label' => __('Replace Title', 'graphy'), 'section' => 'graphy_logo', 'settings' => 'graphy_replace_blogname', 'type' => 'checkbox'));
$wp_customize->add_setting('graphy_add_border_radius', array('default' => '', 'sanitize_callback' => 'graphy_sanitize_checkbox'));
$wp_customize->add_control('graphy_add_border_radius', array('label' => __('Add Border Radius', 'graphy'), 'section' => 'graphy_logo', 'settings' => 'graphy_add_border_radius', 'type' => 'checkbox'));
$wp_customize->add_setting('graphy_link_color', array('default' => '#a62425', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'graphy_link_color', array('label' => __('Link Color', 'graphy'), 'section' => 'colors', 'settings' => 'graphy_link_color')));
$wp_customize->add_setting('graphy_link_hover_color', array('default' => '#b85051', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'graphy_link_hover_color', array('label' => __('Link Hover Color', 'graphy'), 'section' => 'colors', 'settings' => 'graphy_link_hover_color')));
$wp_customize->add_setting('graphy_hide_search', array('default' => '', 'sanitize_callback' => 'graphy_sanitize_checkbox'));
$wp_customize->add_control('graphy_hide_search', array('label' => __('Hide Serach', 'graphy'), 'section' => 'nav', 'settings' => 'graphy_hide_search', 'type' => 'checkbox'));
$wp_customize->add_section('graphy_article', array('title' => __('Article', 'graphy'), 'priority' => 100));
$wp_customize->add_setting('graphy_content', array('default' => 'summary', 'sanitize_callback' => 'graphy_sanitize_content'));
$wp_customize->add_control('graphy_content', array('label' => __('Display', 'graphy'), 'section' => 'graphy_article', 'settings' => 'graphy_content', 'type' => 'select', 'choices' => array('summary' => __('Summary', 'graphy'), 'content' => __('Full text', 'graphy'))));
$wp_customize->add_setting('graphy_hide_author', array('default' => '', 'sanitize_callback' => 'graphy_sanitize_checkbox'));
$wp_customize->add_control('graphy_hide_author', array('label' => __('Hide Author', 'graphy'), 'section' => 'graphy_article', 'settings' => 'graphy_hide_author', 'type' => 'checkbox'));
$wp_customize->add_setting('graphy_hide_category', array('default' => '', 'sanitize_callback' => 'graphy_sanitize_checkbox'));
$wp_customize->add_control('graphy_hide_category', array('label' => __('Hide Categories', 'graphy'), 'section' => 'graphy_article', 'settings' => 'graphy_hide_category', 'type' => 'checkbox'));
}
示例13: wedge_customizer_register
/**
* @param WP_Customize_Manager $wp_customize
*/
function wedge_customizer_register($wp_customize)
{
$wp_customize->add_section('wedge_customizer_aside', array('title' => __('Aside', 'wedge'), 'priority' => 90));
$wp_customize->add_section('wedge_customizer_basic', array('title' => __('Theme Options', 'wedge'), 'priority' => 150));
// ### TITLE TAGLINE ###
// Logo Image Upload
$wp_customize->add_setting('wedge_customizer_logo', array('sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'wedge_customizer_logo', array('label' => __('Logo Upload', 'wedge'), 'section' => 'title_tagline', 'settings' => 'wedge_customizer_logo')));
// Logo Image Background Upload
$wp_customize->add_setting('wedge_customizer_logo_bg', array('sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'wedge_customizer_logo_bg', array('label' => __('Logo-Background Upload', 'wedge'), 'section' => 'title_tagline', 'settings' => 'wedge_customizer_logo_bg')));
// Hide Title?
$wp_customize->add_setting('wedge_customizer_hide_title', array('default' => false));
$wp_customize->add_control('wedge_customizer_hide_title', array('label' => __('Hide the Title', 'wedge'), 'section' => 'title_tagline', 'type' => 'checkbox'));
// Hide Description?
$wp_customize->add_setting('wedge_customizer_hide_desc', array('default' => false));
$wp_customize->add_control('wedge_customizer_hide_desc', array('label' => __('Hide the Description', 'wedge'), 'section' => 'title_tagline', 'type' => 'checkbox'));
// ### COLORS ###
// Color Scheme
$wp_customize->add_setting('wedge_customizer_sidebar_color', array('default' => 'light', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wedge_sanitize_scheme_select'));
$wp_customize->add_control('wedge_customizer_sidebar_color_select', array('settings' => 'wedge_customizer_sidebar_color', 'label' => __('Sidebar Color', 'wedge'), 'section' => 'colors', 'type' => 'select', 'choices' => array('dark' => __('Dark', 'wedge'), 'light' => __('Light', 'wedge'))));
// ### ASIDE ###
// Show Search-Bar
$wp_customize->add_setting('wedge_customizer_sidebar_search', array('default' => false));
$wp_customize->add_control('wedge_customizer_sidebar_search', array('label' => __('Show searchform in sidebar', 'wedge'), 'section' => 'wedge_customizer_aside', 'type' => 'checkbox'));
// Featured Category Dropdown
$wp_customize->add_setting('wedge_featured_cat', array('default' => '0', 'sanitize_callback' => 'wedge_sanitize_integer'));
$wp_customize->add_control(new WP_Customize_Category_Control($wp_customize, 'wedge_featured_cat', array('label' => __('Featured Post Category', 'wedge'), 'section' => 'wedge_customizer_aside', 'settings' => 'wedge_featured_cat')));
}
示例14: twentyfifteen_customize_register
/**
* Add postMessage support for site title and description for the Customizer.
*
* @since Meed Networks 1.0
*
* @param WP_Customize_Manager $wp_customize Customizer object.
*/
function twentyfifteen_customize_register($wp_customize)
{
//$color_scheme = twentyfifteen_get_color_scheme();
$wp_customize->get_setting('blogname')->transport = 'refresh';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
//add control for the header and tagline
$wp_customize->add_section('Home-Header', array('title' => __('Text Description For The Home', 'meednetworks'), 'priority' => 15));
$wp_customize->add_setting('home_header', array('default' => 'Nigeria Leading Network Infrastructure', 'transport' => 'refresh'));
$wp_customize->add_control('home_header', array('label' => __('header_text', 'meednetworks'), 'section' => 'Home-Header', 'type' => 'text', 'priority' => 1));
$wp_customize->add_setting('home_header_text', array('default' => 'We have a strong focus on using information technology to improve the operational efficiencies of institutions and organisations of different sizes. From integrated networks, fiber optics, cabling systems, Wireless/LAN, telecom infrastructure, biometrics, test and network security, our portfolio of ground-breaking solutions speak volume about our experience. See why you should work with us?', 'transport' => 'refresh'));
$wp_customize->add_control('home_header_text', array('label' => __('Home Header Text', 'meednetworks'), 'section' => 'Home-Header', 'type' => 'textarea', 'priority' => 2));
// Add control for the blog scheme setting and control.
$wp_customize->add_section('Blog_summary', array('title' => __('Blog Summary', 'meednetworks'), 'priority' => 30));
$wp_customize->add_setting('Blog_post_header', array('default' => 'Blog Post header', 'transport' => 'refresh'));
$wp_customize->add_control('Blog_post_header', array('label' => __('Blog Post', 'meednetworks'), 'section' => 'Blog_summary', 'type' => 'text', 'priority' => 1));
$wp_customize->add_setting('Blog_post_sub', array('default' => 'Latest Blog Posts', 'transport' => 'refresh'));
$wp_customize->add_control('Blog_post_sub', array('label' => __('Blog Post', 'meednetworks'), 'section' => 'Blog_summary', 'type' => 'text', 'priority' => 2));
$wp_customize->add_setting('Blog_post_summary', array('default' => 'We use the Meed Blog as a medium to articulate and share some of the knowledge and experiences we gain from the field. The objective is simply to improve the industry.', 'transport' => 'refresh'));
$wp_customize->add_control('Blog_post_summary', array('label' => __('Blog Post Text', 'meednetworks'), 'section' => 'Blog_summary', 'type' => 'textarea', 'priority' => 3));
//footer texts
// Add control for the blog scheme setting and control.
$wp_customize->add_section('Footer_text', array('title' => __('Footer Bar', 'meednetworks'), 'priority' => 30));
$wp_customize->add_setting('copyright', array('default' => '© Copyright 2014 Meed Networks Limited. Website by Ultractiv. All Rights Reserved.', 'transport' => 'refresh'));
$wp_customize->add_control('copyright', array('label' => __('copyright', 'meednetworks'), 'section' => 'Footer_text', 'type' => 'text', 'priority' => 1));
}
示例15: maker_theme_customize_register
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function maker_theme_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';
// Add Social Media Section
$wp_customize->add_section('social-media', array('title' => __('Social Media', 'maker'), 'priority' => 30, 'description' => __('Enter the URL to your account for each service for the icon to appear in the footer.', '')));
// Add Twitter Setting
$wp_customize->add_setting('twitter', array('default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'twitter', array('label' => __('Twitter', 'maker'), 'section' => 'social-media', 'settings' => 'twitter')));
// Add Facebook Setting
$wp_customize->add_setting('facebook', array('default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'facebook', array('label' => __('Facebook', 'maker'), 'section' => 'social-media', 'settings' => 'facebook')));
// Add Instagram Setting
$wp_customize->add_setting('instagram', array('default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'Instagram', array('label' => __('Instagram', 'maker'), 'section' => 'social-media', 'settings' => 'instagram')));
// Footer Contact Info
$wp_customize->add_section('contact-info', array('title' => __('Contact Info (in footer)', 'maker'), 'priority' => 30, 'description' => __('', '')));
// Add Twitter Setting
$wp_customize->add_setting('email', array('default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_email'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'email', array('label' => __('Email Address', 'maker'), 'section' => 'contact-info', 'settings' => 'email')));
// Add Facebook Setting
$wp_customize->add_setting('phone', array('default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_html'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'phone', array('label' => __('Phone Number', 'maker'), 'section' => 'contact-info', 'settings' => 'phone')));
}