本文整理汇总了PHP中object::add_section方法的典型用法代码示例。如果您正苦于以下问题:PHP object::add_section方法的具体用法?PHP object::add_section怎么用?PHP object::add_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::add_section方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jobify_customize_register_sections
/**
* Register two new sections: General, and Social.
*
* @since Jobify 1.0
*
* @param object $wp_customize
* @return void
*/
function jobify_customize_register_sections($wp_customize)
{
$wp_customize->add_section('jobify_general', array('title' => _x('General', 'Theme customizer section title', 'jobify'), 'priority' => 10));
$wp_customize->add_section('jobify_listings', array('title' => sprintf(__('Jobs%s', 'jobify'), class_exists('WP_Resume_Manager') ? '/Resumes' : ''), 'priority' => 11));
$wp_customize->add_section('map', array('title' => __('Map', 'jobify'), 'priority' => 12));
$wp_customize->add_section('jobify_cta', array('title' => _x('Call to Action', 'Theme customizer section title', 'jobify'), 'priority' => 900));
}
示例2: tcx_register_theme_customizer
/**
* Registers options with the Theme Customizer
*
* @param object $wp_customize The WordPress Theme Customizer
* @package tcx
* @since 0.2.0
* @version 1.0.0
*/
function tcx_register_theme_customizer($wp_customize)
{
$wp_customize->add_setting('tcx_link_color', array('default' => '#000000', 'sanitize_callback' => 'tcx_sanitize_input', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_color', array('label' => 'Link Color', 'section' => 'colors', 'settings' => 'tcx_link_color')));
/*-----------------------------------------------------------*
* Defining our own 'Display Options' section
*-----------------------------------------------------------*/
$wp_customize->add_section('tcx_display_options', array('title' => 'Display Options', 'priority' => 200));
/* Display Header */
$wp_customize->add_setting('tcx_display_header', array('default' => 'true', 'sanitize_callback' => 'tcx_sanitize_input', 'transport' => 'postMessage'));
$wp_customize->add_control('tcx_display_header', array('section' => 'tcx_display_options', 'label' => 'Display Header?', 'type' => 'checkbox'));
/* Change Color Scheme */
$wp_customize->add_setting('tcx_color_scheme', array('default' => 'normal', 'sanitize_callback' => 'tcx_sanitize_input', 'transport' => 'postMessage'));
$wp_customize->add_control('tcx_color_scheme', array('section' => 'tcx_display_options', 'label' => 'Color Scheme', 'type' => 'radio', 'choices' => array('normal' => 'Normal', 'inverse' => 'Inverse')));
/* Change Font */
$wp_customize->add_setting('tcx_font', array('default' => 'times', 'sanitize_callback' => 'tcx_sanitize_input', 'transport' => 'postMessage'));
$wp_customize->add_control('tcx_font', array('section' => 'tcx_display_options', 'label' => 'Theme Font', 'type' => 'select', 'choices' => array('times' => 'Times New Roman', 'arial' => 'Arial', 'courier' => 'Courier New')));
/* Display Copyright */
$wp_customize->add_setting('tcx_footer_copyright_text', array('default' => 'All Rights Reserved', 'sanitize_callback' => 'tcx_sanitize_input', 'transport' => 'postMessage'));
$wp_customize->add_control('tcx_footer_copyright_text', array('section' => 'tcx_display_options', 'label' => 'Copyright Message', 'type' => 'text'));
/*-----------------------------------------------------------*
* Defining our own 'Advanced Options' section
*-----------------------------------------------------------*/
$wp_customize->add_section('tcx_advanced_options', array('title' => 'Advanced Options', 'priority' => 201));
/* Background Image */
$wp_customize->add_setting('tcx_background_image', array('default' => '', 'sanitize_callback' => 'tcx_sanitize_input', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'tcx_background_image', array('label' => 'Background Image', 'settings' => 'tcx_background_image', 'section' => 'tcx_advanced_options')));
}
示例3: flat_customize_register
/**
* Register customizer controls
*
* @param object $wp_customize The WordPress customizer object
*/
function flat_customize_register($wp_customize)
{
// Logo
$wp_customize->add_setting('flat_theme_options[logo]', array('capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => __('Site Logo', 'flat'), 'section' => 'title_tagline', 'settings' => 'flat_theme_options[logo]')));
// Site Title Font Family
$wp_customize->add_setting('flat_theme_options[site_title_font_family]', array('default' => 'yesteryear', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_site_title_font_family'));
$wp_customize->add_control('site_title_font_family', array('settings' => 'flat_theme_options[site_title_font_family]', 'label' => __('Site Title Font Family', 'flat'), 'section' => 'title_tagline', 'type' => 'select', 'choices' => array('Amatic+SC' => 'Amatic SC', 'Yesteryear' => 'Yesteryear', 'Pacifico' => 'Pacifico', 'Dancing+Script' => 'Dancing Script', 'Satisfy' => 'Satisfy', 'Handlee' => 'Handlee', 'Lobster' => 'Lobster', 'Lobster+Two' => 'Lobster Two')));
// Header Display
$wp_customize->add_setting('flat_theme_options[header_display]', array('default' => 'site_title', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_header_display'));
$wp_customize->add_control('header_display', array('settings' => 'flat_theme_options[header_display]', 'label' => 'Display as', 'section' => 'title_tagline', 'type' => 'select', 'choices' => array('site_title' => __('Site Title', 'flat'), 'site_logo' => __('Site Logo', 'flat'), 'both_title_logo' => __('Both Title & Logo', 'flat'))));
// Favicon
$wp_customize->add_setting('flat_theme_options[favicon]', array('capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'favicon', array('label' => __('Site Favicon', 'flat'), 'section' => 'title_tagline', 'settings' => 'flat_theme_options[favicon]')));
// Color
$wp_customize->add_setting('flat_theme_options[sidebar_background_color]', array('capability' => 'edit_theme_options', 'type' => 'option', 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'sidebar_background_color', array('label' => __('Sidebar Background Color', 'flat'), 'section' => 'colors', 'settings' => 'flat_theme_options[sidebar_background_color]')));
// Background Size
$wp_customize->add_setting('flat_theme_options[background_size]', array('default' => 'cover', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_background_size'));
$wp_customize->add_control('background_size', array('settings' => 'flat_theme_options[background_size]', 'label' => __('Background size', 'flat'), 'section' => 'background_image', 'type' => 'radio', 'choices' => array('cover' => __('Cover', 'flat'), 'contain' => __('Contain', 'flat'), 'initial' => __('Initial', 'flat'))));
// Typography
$wp_customize->add_section('typography', array('title' => __('Typography', 'flat'), 'priority' => 50));
// Global Font Family
$wp_customize->add_setting('flat_theme_options[global_font_family]', array('default' => 'Roboto', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_global_font_family'));
$wp_customize->add_control('global_font_family', array('settings' => 'flat_theme_options[global_font_family]', 'label' => __('Global Font Family', 'flat'), 'section' => 'typography', 'type' => 'select', 'choices' => array('Roboto:400,700' => 'Roboto', 'Lato:400,700' => 'Lato', 'Droid+Sans:400,700' => 'Droid Sans', 'Open+Sans:400,700' => 'Open Sans', 'PT+Sans:400,700' => 'PT Sans', 'Source+Sans+Pro:400,700' => 'Source Sans Pro')));
// Heading Font Family
$wp_customize->add_setting('flat_theme_options[heading_font_family]', array('default' => 'Roboto Slab', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_heading_font_family'));
$wp_customize->add_control('heading_font_family', array('settings' => 'flat_theme_options[heading_font_family]', 'label' => __('Heading Font Family', 'flat'), 'section' => 'typography', 'type' => 'select', 'choices' => array('Roboto+Slab' => 'Roboto Slab', 'Droid+Serif' => 'Droid Serif', 'Lora' => 'Lora', 'Bitter' => 'Bitter', 'Arvo' => 'Arvo', 'PT+Serif' => 'PT Serif', 'Rokkitt' => 'Rokkitt', 'Open+Sans+Condensed' => 'Open Sans Condensed')));
// Sub-Heading Font Family
$wp_customize->add_setting('flat_theme_options[sub_heading_font_family]', array('default' => 'Roboto Condensed', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_subheading_font_family'));
$wp_customize->add_control('sub_heading_font_family', array('settings' => 'flat_theme_options[sub_heading_font_family]', 'label' => __('Sub-Heading Font Family', 'flat'), 'section' => 'typography', 'type' => 'select', 'choices' => array('Roboto+Condensed' => 'Roboto Condensed', 'Open+Sans+Condensed' => 'Open Sans Condensed', 'PT+Sans+Narrow' => 'PT Sans Narrow', 'Dosis' => 'Dosis', 'Abel' => 'Abel', 'News+Cycle' => 'News Cycle')));
// Single Post Settings
$wp_customize->add_section('layout_single', array('title' => __('Single Post', 'flat'), 'priority' => 110));
// Single Featured Image
$wp_customize->add_setting('flat_theme_options[single_featured_image]', array('default' => '1', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_checkbox'));
$wp_customize->add_control('single_featured_image', array('label' => __('Hide Featured Image', 'flat'), 'section' => 'layout_single', 'settings' => 'flat_theme_options[single_featured_image]', 'type' => 'checkbox'));
// Single Metadata
$wp_customize->add_setting('flat_theme_options[single_metadata]', array('default' => '0', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_checkbox'));
$wp_customize->add_control('single_metadata', array('label' => __('Hide Metadata', 'flat'), 'section' => 'layout_single', 'settings' => 'flat_theme_options[single_metadata]', 'type' => 'checkbox'));
// Single Author Box
$wp_customize->add_setting('flat_theme_options[single_author_box]', array('default' => '0', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_checkbox'));
$wp_customize->add_control('single_author_box', array('label' => __('Hide Author Box', 'flat'), 'section' => 'layout_single', 'settings' => 'flat_theme_options[single_author_box]', 'type' => 'checkbox'));
// Archive Settings
$wp_customize->add_section('layout_archive', array('title' => __('Archive Pages', 'flat'), 'priority' => 100));
// Archive Featured Image
$wp_customize->add_setting('flat_theme_options[archive_featured_image]', array('default' => '0', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_checkbox'));
$wp_customize->add_control('archive_featured_image', array('label' => __('Hide Featured Image', 'flat'), 'section' => 'layout_archive', 'settings' => 'flat_theme_options[archive_featured_image]', 'type' => 'checkbox'));
// Archive Metadata
$wp_customize->add_setting('flat_theme_options[archive_metadata]', array('default' => '0', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_checkbox'));
$wp_customize->add_control('archive_metadata', array('label' => __('Hide Metadata', 'flat'), 'section' => 'layout_archive', 'settings' => 'flat_theme_options[archive_metadata]', 'type' => 'checkbox'));
// Archive Content
$wp_customize->add_setting('flat_theme_options[archive_content]', array('default' => '0', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'flat_sanitize_checkbox'));
$wp_customize->add_control('archive_content', array('label' => __('Show Post Excerpt', 'flat'), 'section' => 'layout_archive', 'settings' => 'flat_theme_options[archive_content]', 'type' => 'checkbox'));
}
示例4: customizations
/**
* Customizations
*
* @access public
* @param object $wp_customize
* @return void
*/
public static function customizations($wp_customize)
{
$wp_customize->add_section('realia_measurement', array('title' => __('Realia Measurement', 'realia'), 'priority' => 1));
// Area unit
$wp_customize->add_setting('realia_measurement_area_unit', array('default' => 'sqft', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_measurement_area_unit', array('label' => __('Area Unit', 'realia'), 'section' => 'realia_measurement', 'settings' => 'realia_measurement_area_unit'));
}
示例5: zeepersonal_customize_register_post_settings
/**
* Adds post settings in the Customizer
*
* @param object $wp_customize / Customizer Object
*/
function zeepersonal_customize_register_post_settings($wp_customize)
{
// Add Sections for Post Settings
$wp_customize->add_section('zeepersonal_section_post', array('title' => esc_html__('Post Settings', 'zeepersonal'), 'priority' => 30, 'panel' => 'zeepersonal_options_panel'));
// Add Settings and Controls for post content
$wp_customize->add_setting('zeepersonal_theme_options[post_content]', array('default' => 'excerpt', 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_post_content'));
$wp_customize->add_control('zeepersonal_control_post_content', array('label' => esc_html__('Post length on archives', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[post_content]', 'type' => 'radio', 'priority' => 1, 'choices' => array('index' => esc_html__('Show full posts', 'zeepersonal'), 'excerpt' => esc_html__('Show post excerpts', 'zeepersonal'))));
// Add Setting and Control for Excerpt Length
$wp_customize->add_setting('zeepersonal_theme_options[excerpt_length]', array('default' => 30, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'absint'));
$wp_customize->add_control('zeepersonal_control_excerpt_length', array('label' => esc_html__('Excerpt Length', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[excerpt_length]', 'type' => 'text', 'active_callback' => 'zeepersonal_control_post_content_callback', 'priority' => 2));
// Add Post Images Settings
$wp_customize->add_setting('zeepersonal_theme_options[post_images_headline]', array('default' => '', 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr'));
$wp_customize->add_control(new zeePersonal_Customize_Header_Control($wp_customize, 'zeepersonal_control_post_images_headline', array('label' => esc_html__('Post Images', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[post_images_headline]', 'priority' => 3)));
$wp_customize->add_setting('zeepersonal_theme_options[post_thumbnail_archives]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_post_thumbnail_archive', array('label' => esc_html__('Display featured images on archives', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[post_thumbnail_archives]', 'type' => 'checkbox', 'priority' => 4));
$wp_customize->add_setting('zeepersonal_theme_options[post_thumbnail_single]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_post_thumbnail_single', array('label' => esc_html__('Display featured images on single posts', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[post_thumbnail_single]', 'type' => 'checkbox', 'priority' => 5));
// Add Post Meta Settings
$wp_customize->add_setting('zeepersonal_theme_options[post_meta_headline]', array('default' => '', 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr'));
$wp_customize->add_control(new zeePersonal_Customize_Header_Control($wp_customize, 'zeepersonal_control_post_meta_headline', array('label' => esc_html__('Post Meta', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[post_meta_headline]', 'priority' => 6)));
$wp_customize->add_setting('zeepersonal_theme_options[meta_date]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_meta_date', array('label' => esc_html__('Display post date', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[meta_date]', 'type' => 'checkbox', 'priority' => 7));
$wp_customize->add_setting('zeepersonal_theme_options[meta_author]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_meta_author', array('label' => esc_html__('Display post author', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[meta_author]', 'type' => 'checkbox', 'priority' => 8));
$wp_customize->add_setting('zeepersonal_theme_options[meta_category]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_meta_category', array('label' => esc_html__('Display post categories', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[meta_category]', 'type' => 'checkbox', 'priority' => 9));
$wp_customize->add_setting('zeepersonal_theme_options[meta_comments]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_meta_comments', array('label' => esc_html__('Display post comments', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[meta_comments]', 'type' => 'checkbox', 'priority' => 10));
$wp_customize->add_setting('zeepersonal_theme_options[meta_tags]', array('default' => true, 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_checkbox'));
$wp_customize->add_control('zeepersonal_control_meta_tags', array('label' => esc_html__('Display post tags', 'zeepersonal'), 'section' => 'zeepersonal_section_post', 'settings' => 'zeepersonal_theme_options[meta_tags]', 'type' => 'checkbox', 'priority' => 11));
}
示例6: customizations
/**
* Customizations
*
* @access public
* @param object $wp_customize
* @return void
*/
public static function customizations($wp_customize)
{
$pages = Realia_Pages::get_pages();
$wp_customize->add_section('realia_general', array('title' => __('Realia General', 'realia'), 'priority' => 1));
// Under construction
$wp_customize->add_setting('realia_general_under_construction_page', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_under_construction_page', array('type' => 'select', 'label' => __('Under Construction Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_under_construction_page', 'choices' => $pages));
// Cookie policy
$wp_customize->add_setting('realia_general_cookie_policy_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_cookie_policy_page', array('type' => 'select', 'label' => __('Cookie Policy Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_cookie_policy_page', 'choices' => $pages));
if (current_theme_supports('realia-compare')) {
// Compare page
$wp_customize->add_setting('realia_general_compare_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_compare_page', array('type' => 'select', 'label' => __('Compare Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_compare_page', 'choices' => $pages));
}
if (current_theme_supports('realia-favorite')) {
// Favorites page
$wp_customize->add_setting('realia_general_favorites_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_favorites_page', array('type' => 'select', 'label' => __('Favorites Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_favorites_page', 'choices' => $pages));
}
// Login required
$wp_customize->add_setting('realia_general_login_required_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_login_required_page', array('type' => 'select', 'label' => __('Login Required Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_login_required_page', 'choices' => $pages));
// After login page
$wp_customize->add_setting('realia_general_after_login_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_after_login_page', array('type' => 'select', 'label' => __('After Login Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_after_login_page', 'choices' => $pages));
// Profile page
$wp_customize->add_setting('realia_general_profile_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_profile_page', array('type' => 'select', 'label' => __('Profile Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_profile_page', 'choices' => $pages));
// Change password page
$wp_customize->add_setting('realia_general_password_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_password_page', array('type' => 'select', 'label' => __('Password Page', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_password_page', 'choices' => $pages));
if (current_theme_supports('realia-statistics')) {
// Query logging
$wp_customize->add_setting('realia_general_enable_query_logging', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_enable_query_logging', array('type' => 'checkbox', 'label' => __('Enable Search Query Logging', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_enable_query_logging'));
// Property logging
$wp_customize->add_setting('realia_general_enable_property_logging', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_enable_property_logging', array('type' => 'checkbox', 'label' => __('Enable Property Views Logging', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_enable_property_logging'));
}
// Enable reviews
$wp_customize->add_setting('realia_general_enable_reviews', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_enable_reviews', array('type' => 'checkbox', 'label' => __('Enable Reviews', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_enable_reviews'));
if (current_theme_supports('realia-compare')) {
// Enable compare
$wp_customize->add_setting('realia_general_enable_compare', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_enable_compare', array('type' => 'checkbox', 'label' => __('Enable Compare', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_enable_compare'));
}
if (current_theme_supports('realia-favorites')) {
// Enable favorites
$wp_customize->add_setting('realia_general_enable_favorites', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_enable_favorites', array('type' => 'checkbox', 'label' => __('Enable Favorites', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_enable_favorites'));
}
// Hide unassigned amenities
$wp_customize->add_setting('realia_general_hide_unassigned_amenities', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_hide_unassigned_amenities', array('type' => 'checkbox', 'label' => __('Hide Unassigned Amenities', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_hide_unassigned_amenities'));
// Show property archive as grid
$wp_customize->add_setting('realia_general_show_property_archive_as_grid', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('realia_general_show_property_archive_as_grid', array('type' => 'checkbox', 'label' => __('Show property archive as grid', 'realia'), 'section' => 'realia_general', 'settings' => 'realia_general_show_property_archive_as_grid'));
}
示例7: currency_settings
/**
* Creates currency options
*
* @access public
* @param object $wp_customize
* @param int $count
* @return void
*/
public static function currency_settings($wp_customize, $count)
{
for ($i = 1; $i <= $count; $i++) {
$wp_customize->add_section("realia_currencies[{$i}]", array('title' => __('Realia', 'realia') . ' ' . ($i + 1) . '. ' . __('Currency', 'realia'), 'priority' => 1));
// Currency symbol
$wp_customize->add_setting("realia_currencies[{$i}][symbol]", array('default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}][symbol]", array('label' => __('Currency Symbol', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][symbol]"));
// Currency code
$wp_customize->add_setting("realia_currencies[{$i}][code]", array('default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}][code]", array('label' => __('Currency Code', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][code]"));
// Show after
$wp_customize->add_setting("realia_currencies[{$i}][show_after]", array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}][show_after]", array('type' => 'checkbox', 'label' => __('Show Symbol After Amount', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][show_after]"));
// Decimal places
$wp_customize->add_setting("realia_currencies[{$i}][money_decimals]", array('default' => 0, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}][money_decimals]", array('label' => __('Decimal places', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][money_decimals]"));
// Decimal separator
$wp_customize->add_setting("realia_currencies[{$i}][money_dec_point]", array('default' => '.', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}]_money_dec_point", array('label' => __('Decimal Separator', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][money_dec_point]"));
// Thousands Separator
$wp_customize->add_setting("realia_currencies[{$i}][money_thousands_separator]", array('default' => ',', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}][money_thousands_separator]", array('label' => __('Thousands Separator', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][money_thousands_separator]", 'description' => __('If you need space, enter &nbsp;', 'realia')));
// Rate
$wp_customize->add_setting("realia_currencies[{$i}][rate]", array('default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control("realia_currencies[{$i}][rate]", array('label' => __('Rate', 'realia'), 'section' => "realia_currencies[{$i}]", 'settings' => "realia_currencies[{$i}][rate]", 'description' => __('Rate from default currency', 'realia')));
}
}
示例8: zeepersonal_customize_register_general_settings
/**
* Adds all general settings to the Customizer
*
* @param object $wp_customize / Customizer Object
*/
function zeepersonal_customize_register_general_settings($wp_customize)
{
// Add Section for Theme Options
$wp_customize->add_section('zeepersonal_section_general', array('title' => esc_html__('General Settings', 'zeepersonal'), 'priority' => 10, 'panel' => 'zeepersonal_options_panel'));
// Add Settings and Controls for Layout
$wp_customize->add_setting('zeepersonal_theme_options[layout]', array('default' => 'right-sidebar', 'type' => 'option', 'transport' => 'refresh', 'sanitize_callback' => 'zeepersonal_sanitize_layout'));
$wp_customize->add_control('zeepersonal_control_layout', array('label' => esc_html__('Theme Layout', 'zeepersonal'), 'section' => 'zeepersonal_section_general', 'settings' => 'zeepersonal_theme_options[layout]', 'type' => 'radio', 'priority' => 1, 'choices' => array('left-sidebar' => esc_html__('Left Sidebar', 'zeepersonal'), 'right-sidebar' => esc_html__('Right Sidebar', 'zeepersonal'))));
}
示例9: sections
/**
* Sets up the customizer sections.
*
* @since 1.0.0
* @access public
*
* @param object $manager
*
* @return void
*/
public function sections($manager)
{
// Load custom sections.
require_once trailingslashit(get_template_directory()) . 'inc/shapely-documentation/class-shapely-documentation-customizer.php';
// Register custom section types.
$manager->register_section_type('Shapely_Documentation_Customize_Section');
// Register sections.
$manager->add_section(new Shapely_Documentation_Customize_Section($manager, 'shapely_documentation', array('title' => esc_html__('Shapely', 'shapely'), 'pro_text' => esc_html__('Documentation', 'shapely'), 'pro_url' => 'https://colorlib.com/wp/support/shapely/', 'priority' => 0)));
}
示例10: array
/**
* Customize: Cat/Term Section.
*
* Customizer register function for Cat/Term Section
*
* @param object $wp_customize WP_Customize Instance of the WP_Customize_Manager class.
* @since 1.0.0
*/
function vr_customize_cat_term($wp_customize)
{
// Section: Category/Term.
$wp_customize->add_section('vr_section_cat_term', array('priority' => 39, 'panel' => 'vr_panel_options', 'title' => __('Category/Term', 'VRC'), 'description' => __('Category or Term related settings', 'VRC'), 'capability' => 'edit_theme_options'));
// Setting: Cat/Term Image.
$wp_customize->add_setting('vr_cat_term_img', array('type' => 'theme_mod', 'default' => VRC_URL . '/assets/plugin/category-images/assets/img/placeholder.png', 'transport' => 'refresh', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'vr_sanitize_ci_img'));
// Control: Cat/Term Image.
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'vr_cat_term_img', array('label' => __('Upload a default image for category/term!', 'VRC'), 'section' => 'vr_section_cat_term', 'settings' => 'vr_cat_term_img')));
}
示例11: register
/**
* Register our customizer breadcrumb options for the parent class to load.
*
* @since 1.1.0
* @access public
* @param object $wp_customize
* @return void
*/
public function register($wp_customize)
{
$wp_customize->add_section($this->section, array('title' => __('Breadcrumbs', 'flagship-library'), 'description' => __('Choose where you would like breadcrumbs to display.', 'flagship-library'), 'priority' => 110, 'capability' => $this->capability));
$priority = 10;
foreach ($this->get_options() as $breadcrumb => $setting) {
$wp_customize->add_setting($breadcrumb, array('default' => $setting['default'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
$wp_customize->add_control($breadcrumb, array('label' => $setting['label'], 'section' => $this->section, 'type' => 'checkbox', 'priority' => $priority++));
}
}
示例12: omega_customize_comment_register
/**
* Registers custom sections, settings, and controls for the $wp_customize instance.
*
* @since 0.3.2
* @access private
* @param object $wp_customize
*/
function omega_customize_comment_register($wp_customize)
{
/* Add the comment section. */
$wp_customize->add_section('comment_section', array('title' => esc_html__('Comments', 'omega'), 'priority' => 121, 'capability' => 'edit_theme_options'));
/* Add the 'custom_comment' setting. */
$wp_customize->add_setting("page_comment", array('default' => false, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
/* Add the checkbox control for the 'custom_comment' setting. */
$wp_customize->add_control(new Omega_Customize_Control_Checkbox($wp_customize, 'page_comment', array('label' => esc_html__('Enable comments on pages ', 'omega'), 'section' => 'comment_section', 'settings' => 'page_comment', 'extra' => esc_html__('This option will enable comments on pages. Comments can also be disabled per page basis when creating/editing pages.', 'omega'))));
}
示例13: omega_customize_logo_register
/**
* Registers custom sections, settings, and controls for the $wp_customize instance.
*
* @since 0.3.2
* @access private
* @param object $wp_customize
*/
function omega_customize_logo_register($wp_customize)
{
/* Add the footer section. */
$wp_customize->add_section('title_tagline', array('title' => esc_html__('Branding', 'omega'), 'priority' => 1, 'capability' => 'edit_theme_options'));
/* Add the 'custom_css' setting. */
$wp_customize->add_setting("custom_logo", array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options'));
/* Add the textarea control for the 'custom_css' setting. */
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'custom_logo', array('label' => esc_html__('Logo', 'omega'), 'section' => 'title_tagline', 'settings' => "custom_logo")));
}
示例14: peacock_register_theme_customizer
/**
* Registers options with the Theme Customizer
*
* @param object $wp_customize The WordPress Theme Customizer
* @package peacock
* @since 1.0.0
* @version 1.0.0
*/
function peacock_register_theme_customizer($wp_customize)
{
$wp_customize->add_section('peacock_mainheader_options', array('title' => __('Main Header Section', 'peacock'), 'priority' => 20));
/* Home Cta Title */
$wp_customize->add_setting('peacock_mainheader_title', array('default' => __('Wordpress With Peacock', 'peacock'), 'sanitize_callback' => 'peacock_sanitize_input', 'transport' => 'refresh'));
$wp_customize->add_control('peacock_mainheader_title', array('section' => 'peacock_mainheader_options', 'label' => __('Title', 'peacock'), 'type' => 'text'));
/* Home Cta Subtitle */
$wp_customize->add_setting('peacock_mainheader_subtitle', array('default' => __('Life is short', 'peacock'), 'sanitize_callback' => 'peacock_sanitize_input', 'transport' => 'refresh'));
$wp_customize->add_control('peacock_mainheader_subtitle', array('section' => 'peacock_mainheader_options', 'label' => __('Subtitle', 'peacock'), 'type' => 'text'));
}
示例15: kuorinka_plus_logo_customize_register
/**
* Add our logo uploader to the Customizer.
*
* @param object $wp_customize Customizer object.
* @uses $wp_customize->add_setting
* @uses $wp_customize->add_control
* @since 1.0.0
*/
function kuorinka_plus_logo_customize_register($wp_customize)
{
/* === Logo upload. === */
/* Add the logo section. */
$wp_customize->add_section('logo', array('title' => esc_html__('Logo', 'kuorinka-plus'), 'priority' => 10, 'panel' => 'kuorinka_plus_panel'));
/* Add the setting for our logo value. */
$wp_customize->add_setting('site_logo', array('default' => '', 'sanitize_callback' => 'absint'));
/* Add our image uploader. */
$wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'site_logo', array('label' => __('Site Logo', 'kuorinka-plus'), 'section' => 'logo', 'flex_width' => true, 'flex_height' => true, 'width' => 240, 'height' => 80)));
}