/** * 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)); }
/** * 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'))); }
/** * 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')); }
/** * 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')); }
/** * 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)); }
/** * 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')); }
/** * 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'))); } }
/** * 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')))); }
/** * 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))); }
/** * 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'))); }
/** * 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++)); } }
/** * 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')))); }
/** * 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"))); }
/** * 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')); }
/** * 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))); }
/** * Customizations * * @access public * @param object $wp_customize * @return void */ public static function customizations($wp_customize) { $wp_customize->add_section('realia_recaptcha', array('title' => __('Realia reCAPTCHA', 'realia'), 'priority' => 1)); // Site key $wp_customize->add_setting('realia_recaptcha_site_key', array('capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_recaptcha_site_key', array('label' => __('Site Key', 'realia'), 'section' => 'realia_recaptcha', 'settings' => 'realia_recaptcha_site_key')); // Secret key $wp_customize->add_setting('realia_recaptcha_secret_key', array('capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_recaptcha_secret_key', array('label' => __('Secret Key', 'realia'), 'section' => 'realia_recaptcha', 'settings' => 'realia_recaptcha_secret_key')); }
/** * Register our customizer breadcrumb options for the parent class to load. * * @since 1.0.0 * @access public * @param object $wp_customize The WordPress customizer API object. * @return void */ function carelib_register_breadcrumb_settings($wp_customize) { $section = "{$GLOBALS['carelib_prefix']}_breadcrumbs"; $wp_customize->add_section($section, array('title' => __('Breadcrumbs', 'carelib'), 'description' => __('Choose where you would like breadcrumbs to display.', 'carelib'), 'priority' => 110, 'capability' => 'edit_theme_options')); $priority = 10; foreach (carelib_get_breadcrumb_options() as $breadcrumb => $setting) { $wp_customize->add_setting($breadcrumb, array('default' => $setting['default'], 'sanitize_callback' => 'absint')); $wp_customize->add_control($breadcrumb, array('label' => $setting['label'], 'section' => $section, 'type' => 'checkbox', 'priority' => $priority++)); } }
/** * Register customizer panels, sections, settings, and controls. * * @since 1.0.0 * @access public * @param object $wp_customize * @return void */ function ctypo_customize_register($wp_customize) { // Load customizer typography control class. require_once trailingslashit(plugin_dir_path(__FILE__)) . 'customize/control-typography.php'; // Register typography control JS template. $wp_customize->register_control_type('Customizer_Typo_Control_Typography'); /* === Testing === */ // Add the typography panel. $wp_customize->add_panel('typography', array('priority' => 5, 'title' => esc_html__('Typography', 'ctypo'))); // Add the `<p>` typography section. $wp_customize->add_section('p_typography', array('panel' => 'typography', 'title' => esc_html__('Paragraphs', 'ctypo'))); // Add the headings typography section. $wp_customize->add_section('headings_typography', array('panel' => 'typography', 'title' => esc_html__('Headings', 'ctypo'))); // Add the `<p>` typography settings. // @todo Better sanitize_callback functions. $wp_customize->add_setting('p_font_family', array('default' => 'Arial', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage')); $wp_customize->add_setting('p_font_weight', array('default' => '400', 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_setting('p_font_style', array('default' => 'normal', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage')); $wp_customize->add_setting('p_font_size', array('default' => '16', 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_setting('p_line_height', array('default' => '32', 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); // Add the `<h1>` typography settings. // @todo Better sanitize_callback functions. $wp_customize->add_setting('h1_font_family', array('default' => 'Georgia', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage')); $wp_customize->add_setting('h1_font_weight', array('default' => '400', 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_setting('h1_font_style', array('default' => 'normal', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage')); //$wp_customize->add_setting( 'h1_font_size', array( 'default' => '28', 'sanitize_callback' => 'absint', 'transport' => 'postMessage' ) ); //$wp_customize->add_setting( 'h1_line_height', array( 'default' => '42', 'sanitize_callback' => 'absint', 'transport' => 'postMessage' ) ); // Add the `<h2>` typography settings. // @todo Better sanitize_callback functions. $wp_customize->add_setting('h2_font_family', array('default' => 'Georgia', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage')); $wp_customize->add_setting('h2_font_weight', array('default' => '400', 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_setting('h2_font_style', array('default' => 'normal', 'sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage')); //$wp_customize->add_setting( 'h2_font_size', array( 'default' => '24', 'sanitize_callback' => 'absint', 'transport' => 'postMessage' ) ); //$wp_customize->add_setting( 'h2_line_height', array( 'default' => '38', 'sanitize_callback' => 'absint', 'transport' => 'postMessage' ) ); // Add the `<p>` typography control. $wp_customize->add_control(new Customizer_Typo_Control_Typography($wp_customize, 'p_typography', array('label' => esc_html__('Paragraph Typography', 'ctypo'), 'description' => __('Select how you want your paragraphs to appear.', 'ctypo'), 'section' => 'p_typography', 'settings' => array('family' => 'p_font_family', 'weight' => 'p_font_weight', 'style' => 'p_font_style', 'size' => 'p_font_size', 'line_height' => 'p_line_height'), 'l10n' => array()))); // Add the `<h1>` typography control. $wp_customize->add_control(new Customizer_Typo_Control_Typography($wp_customize, 'h1_typography', array('label' => esc_html__('Heading 1', 'ctypo'), 'description' => __('Select how heading 1 should appear.', 'ctypo'), 'section' => 'headings_typography', 'settings' => array('family' => 'h1_font_family', 'weight' => 'h1_font_weight', 'style' => 'h1_font_style'), 'l10n' => array()))); // Add the `<h2>` typography control. $wp_customize->add_control(new Customizer_Typo_Control_Typography($wp_customize, 'h2_typography', array('label' => esc_html__('Heading 2', 'ctypo'), 'description' => __('Select how heading 2 should appear.', 'ctypo'), 'section' => 'headings_typography', 'settings' => array('family' => 'h2_font_family', 'weight' => 'h2_font_weight', 'style' => 'h2_font_style'), 'l10n' => array()))); /* === End Testing === */ }
/** * Registers custom sections, settings, and controls for the $wp_customize instance. * * @since 1.4.0 * @access private * @param object $wp_customize */ function omega_customize_footer_register($wp_customize) { /* Add the section. */ $wp_customize->add_section('footer', array('title' => esc_html__('Footer', 'omega'), 'priority' => 149, 'capability' => 'edit_theme_options')); /* Add the 'footer_insert' setting. */ $wp_customize->add_setting("custom_footer", array('default' => apply_filters('omega_footer_insert', ''), 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'omega_customize_sanitize', 'sanitize_js_callback' => 'omega_customize_sanitize', 'transport' => 'postMessage')); /* Add the textarea control for the 'footer_insert' setting. */ $wp_customize->add_control(new Omega_Customize_Control_Textarea($wp_customize, 'omega-footer', array('label' => esc_html__('Footer Text', 'omega'), 'section' => 'footer', 'settings' => "custom_footer"))); /* If viewing the customize preview screen, add a script to show a live preview. */ if ($wp_customize->is_preview() && !is_admin()) { add_action('wp_footer', 'omega_customize_preview_footer_script', 21); } }
/** * Registers custom sections, settings, and controls for the $wp_customize instance. * * @since 0.3.2 * @access private * @param object $wp_customize */ function omega_customize_css_register($wp_customize) { /* Add the section. */ $wp_customize->add_section('css', array('title' => esc_html__('CSS', 'omega'), 'priority' => 150, 'capability' => 'unfiltered_html')); /* Add the 'custom_css' setting. */ $wp_customize->add_setting("custom_css", array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'omega_custom_css_sanitize', 'transport' => 'postMessage')); /* Add the textarea control for the 'custom_css' setting. */ $wp_customize->add_control(new Omega_Customize_Control_Textarea($wp_customize, 'custom_css', array('label' => '', 'section' => 'css', 'placeholder' => '.classname { background: #fff;}', 'settings' => "custom_css"))); /* If viewing the customize preview screen, add a script to show a live preview. */ if ($wp_customize->is_preview() && !is_admin()) { add_action('wp_footer', 'omega_customize_preview_script', 22); } }
/** * Introduces the fields for the Twitter username, Facebook URL, Pinterest URL, and Google+ URL * into the Theme Customizer * * @param object $wp_customizer A reference to the WordPress Theme Customizer * @since 1.0.0 */ function mayer_theme_customizer($wp_customizer) { // Theme options $wp_customizer->add_section('mayer_theme_options', array('title' => __('Theme', 'mayer'), 'priority' => 300)); _mayer_add_twitter_username($wp_customizer, 1); _mayer_add_facebook_url($wp_customizer, 2); _mayer_add_pinterest_url($wp_customizer, 3); _mayer_add_googleplus_url($wp_customizer, 4); _mayer_add_linkedin_url($wp_customizer, 5); _mayer_add_email_address($wp_customizer, 6); _mayer_display_gravatar($wp_customizer, 7); _mayer_display_footer_social_icons($wp_customizer, 8); _mayer_move_sidebar($wp_customizer, 9); }
/** * Register customizer panels, sections, settings, and controls. * * @since 1.0.0 * @access public * @param object $wp_customize * @return void */ function customize_background_control_customize_register_example($wp_customize) { // Add a custom background panel for testing. $wp_customize->add_section('custom_background_section', array('priority' => 5, 'title' => esc_html__('Custom Background Example', 'customizer-background-control'))); // Registers example_background settings $wp_customize->add_setting('example_background_image_url', array('sanitize_callback' => 'esc_url')); $wp_customize->add_setting('example_background_image_id', array('sanitize_callback' => 'absint')); $wp_customize->add_setting('example_background_repeat', array('default' => 'no-repeat', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_setting('example_background_size', array('default' => 'auto', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_setting('example_background_attach', array('default' => 'scroll', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_setting('example_background_position', array('default' => 'center-center', 'sanitize_callback' => 'sanitize_text_field')); // Registers example_background control $wp_customize->add_control(new Customize_Custom_Background_Control($wp_customize, 'example_background', array('label' => esc_html__('Example Background', 'customizer-background-control'), 'section' => 'custom_background_section', 'settings' => array('image_url' => 'example_background_image_url', 'image_id' => 'example_background_image_id', 'repeat' => 'example_background_repeat', 'size' => 'example_background_size', 'position' => 'example_background_position', 'attach' => 'example_background_attach')))); }
/** * Register the marketpress specific customizer options. In our * case it is a simple color picker to set a specific * key color. * * @param object $wp_customize * @return void */ function helsinki_register_customizer_sections($wp_customize) { // add section for the color switch to set the key colors $enabled_key_color = apply_filters('helsinki_register_customizer_sections_key_color', TRUE); if ($enabled_key_color) { $wp_customize->add_section('colors', array('title' => __('Colors', 'helsinki'), 'priority' => 5)); $wp_customize->add_setting('key_color', array('default' => apply_filters('helsinki_customizer_default_key_color', '#0084cc'), 'transport' => 'refresh', 'sanitize_callback' => 'helsinki_sanitize_color')); $wp_customize->add_setting('footer_link_color', array('default' => apply_filters('helsinki_customizer_default_footer_link_color', '#d36037'), 'transport' => 'refresh', 'sanitize_callback' => 'helsinki_sanitize_color')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'key_color', array('label' => __('Key Color', 'helsinki'), 'description' => __('The key color is the main color of the website. Usually it is the color of the links, hovers and backgrounds.', 'helsinki'), 'section' => 'colors', 'settings' => 'key_color'))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_link_color', array('label' => __('Footer Link Color', 'helsinki'), 'description' => __('This color is for the links in the footer area of the website.', 'helsinki'), 'section' => 'colors', 'settings' => 'footer_link_color'))); } // add section for the custom logo $enabled_logo = apply_filters('helsinki_register_customizer_sections_logo', TRUE); if ($enabled_logo) { $wp_customize->add_section('helsinki_logo_section', array('title' => __('Logo', 'helsinki'), 'priority' => 6, 'description' => __('Upload a logo which usually replaces the default site name and description in the header', 'helsinki'))); $wp_customize->add_setting('helsinki_logo', array('default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw')); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'helsinki_logo', array('label' => __('Logo', 'helsinki'), 'section' => 'helsinki_logo_section', 'settings' => 'helsinki_logo'))); } // adding a new section to the customizer $enabled_social_icons = apply_filters('helsinki_register_customizer_sections_social_icons', TRUE); if ($enabled_social_icons) { $wp_customize->add_section('social_icons_section', array('title' => __('Social Media Icons', 'helsinki'), 'description' => __('In this Section you can enter your Social-Media-Channels to show them in your Theme. To do so, add the URL to your profiles in the inputs below.', 'helsinki'), 'priority' => 7)); $settings = helsinki_get_social_medias(); if (!is_array($settings) || count($settings) < 1) { return; } foreach ($settings as $id => $setting) { $option_key = 'social_icons_section' . '[' . $id . ']'; // adding a new setting to the database $wp_customize->add_setting($id, array('default' => '', 'sanitize_callback' => 'esc_url_raw')); $control_args = array('label' => $setting['label'], 'section' => 'social_icons_section', 'settings' => $id); $control = new WP_Customize_Control($wp_customize, $option_key, $control_args); $wp_customize->add_control($control); } } }
/** * 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_logo' setting. */ $wp_customize->add_setting("custom_logo", array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); /* 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"))); if (!function_exists('has_site_icon') || !has_site_icon()) { /* Add the 'custom_favicon' setting. */ $wp_customize->add_setting("custom_favicon", array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); /* Add the textarea control for the 'custom_css' setting. */ $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'custom_favicon', array('label' => esc_html__('Favicon', 'omega'), 'section' => 'title_tagline', 'settings' => "custom_favicon"))); } }
/** * Add theme customizer sections. * * @since 1.0. * * @param object $wp_customize The main customizer object. * @return void */ function oxford_add_customizer_sections($wp_customize) { if (oxford_is_wpcom()) { // Add the Theme section $wp_customize->add_section('oxford_theme', array('title' => __('Theme', 'oxford'), 'priority' => 161)); oxford_customize_display($wp_customize, 'oxford_theme'); oxford_customize_footer($wp_customize, 'oxford_theme'); } else { // Add the Display section $wp_customize->add_section('oxford_display', array('title' => __('Display', 'oxford'), 'priority' => 161)); oxford_customize_display($wp_customize, 'oxford_display'); // Add the Footer section $wp_customize->add_section('oxford_footer', array('title' => __('Footer', 'oxford'), 'priority' => 162)); oxford_customize_footer($wp_customize, 'oxford_footer'); } }
/** * Customizations * * @access public * @param object $wp_customize * @return void */ public static function customizations($wp_customize) { $wp_customize->add_section('realia_paypal', array('title' => __('Realia PayPal', 'realia'), 'priority' => 1)); // PayPal Client ID $wp_customize->add_setting('realia_paypal_client_id', array('default' => null, 'crability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_paypal_client_id', array('label' => __('Client ID', 'realia'), 'section' => 'realia_paypal', 'settings' => 'realia_paypal_client_id')); // PayPal Client Secret $wp_customize->add_setting('realia_paypal_client_secret', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_paypal_client_secret', array('label' => __('Client Secret', 'realia'), 'section' => 'realia_paypal', 'settings' => 'realia_paypal_client_secret')); // PayPal Live Mode $wp_customize->add_setting('realia_paypal_live', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_paypal_live', array('label' => __('Live Mode', 'realia'), 'type' => 'checkbox', 'section' => 'realia_paypal', 'settings' => 'realia_paypal_live')); // Credit card $wp_customize->add_setting('realia_paypal_credit_card', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_paypal_credit_card', array('label' => __('Credit Card', 'realia'), 'type' => 'checkbox', 'section' => 'realia_paypal', 'settings' => 'realia_paypal_credit_card')); }
/** * Registers a Section in the customizer */ private function registerSection($storage_type, $id, $options, $panel) { // Add the setting prefix. $id = $this->setting_prefix . $id; // Validate the options $validated_options = $this->validator->validate('section', $options); // Attach it to a panel if provided. if ($panel) { $validated_options['panel'] = $panel; } // Register the section $this->wp_customize->add_section($id, $validated_options); // var_dump(array('Section: ' . $id => $validated_options)); // Register it's contents $this->register($options['contents'], $storage_type, $id); }
/** * 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_submission', array('title' => __('Realia Submission', 'realia'), 'priority' => 1)); // Type $wp_customize->add_setting('realia_submission_type', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_type', array('type' => 'select', 'label' => __('Type', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_type', 'choices' => array('free-for-all' => __('Free for all', 'realia'), 'pay-per-post' => __('Pay per post', 'realia'), 'packages' => __('Packages', 'realia')))); // Pay per post - post price $wp_customize->add_setting('realia_submission_pay_per_post_price', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_pay_per_post_price', array('label' => __('Pay per post - Post price', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_pay_per_post_price', 'description' => __('Enter price without any currency. As main currency will be used primary one (first defined).', 'realia'))); // Enable paying for featured $wp_customize->add_setting('realia_submission_enable_featured', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_enable_featured', array('type' => 'checkbox', 'label' => __('Enable pay for featured', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_enable_featured')); // Featured price $wp_customize->add_setting('realia_submission_featured_price', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_featured_price', array('label' => __('Featured price', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_featured_price', 'description' => __('Enter price without any currency. As main currency will be used primary one (first defined).', 'realia'))); // Enable paying for sticky $wp_customize->add_setting('realia_submission_enable_sticky', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_enable_sticky', array('type' => 'checkbox', 'label' => __('Enable pay for sticky', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_enable_sticky')); // Featured price $wp_customize->add_setting('realia_submission_sticky_price', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_sticky_price', array('label' => __('Sticky price', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_sticky_price', 'description' => __('Enter price without any currency. As main currency will be used primary one (first defined).', 'realia'))); // Payment page $wp_customize->add_setting('realia_submission_payment_page', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_payment_page', array('type' => 'select', 'label' => __('Payment Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_payment_page', 'choices' => $pages)); // List Page $wp_customize->add_setting('realia_submission_list_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_list_page', array('type' => 'select', 'label' => __('List Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_list_page', 'choices' => $pages)); // Create Page $wp_customize->add_setting('realia_submission_create_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_create_page', array('type' => 'select', 'label' => __('Create Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_create_page', 'choices' => $pages)); // Edit Page $wp_customize->add_setting('realia_submission_edit_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_edit_page', array('type' => 'select', 'label' => __('Edit Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_edit_page', 'choices' => $pages)); // Remove Page $wp_customize->add_setting('realia_submission_remove_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_remove_page', array('type' => 'select', 'label' => __('Remove Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_remove_page', 'choices' => $pages)); // Transactions Page $wp_customize->add_setting('realia_submission_transactions_page', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_transactions_page', array('type' => 'select', 'label' => __('Transactions Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_transactions_page', 'choices' => $pages)); // Terms and Conditions Page $wp_customize->add_setting('realia_submission_terms', array('default' => null, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_terms', array('type' => 'select', 'label' => __('Terms & Conditions Page', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_terms', 'choices' => $pages)); // Review before submission $wp_customize->add_setting('realia_submission_review_before', array('default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control('realia_submission_review_before', array('type' => 'checkbox', 'label' => __('Review Before Submission', 'realia'), 'section' => 'realia_submission', 'settings' => 'realia_submission_review_before')); }
/** * Registers custom sections, settings, and controls for the $wp_customize instance. * * @param object $wp_customize * @since Cakifo 1.4 */ function cakifo_customize_register($wp_customize) { /* Get the theme prefix. */ $prefix = hybrid_get_prefix(); /* Get the default theme settings. */ $defaults = hybrid_get_default_theme_settings(); $wp_customize->get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; /* Add the Cakifo section */ $wp_customize->add_section('cakifo_customize_settings', array('title' => esc_html__('Cakifo settings', 'cakifo'), 'priority' => 35, 'capability' => 'edit_theme_options')); /** * Link color */ $wp_customize->add_setting("{$prefix}_theme_settings[link_color]", array('default' => cakifo_get_default_link_color(), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_color', array('label' => esc_html__('Link Color', 'cakifo'), 'section' => 'colors', 'settings' => "{$prefix}_theme_settings[link_color]"))); /** * Show slider? */ $wp_customize->add_setting("{$prefix}_theme_settings[featured_show]", array('default' => false, 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('featured_show', array('settings' => "{$prefix}_theme_settings[featured_show]", 'label' => esc_html__('Show "Featured Content" slider?', 'cakifo'), 'section' => 'cakifo_customize_settings', 'type' => 'checkbox')); /** * Slider categories */ // Create category array foreach (get_categories() as $cat) { $categories[$cat->term_id] = $cat->name; } /* Add setting and control */ $wp_customize->add_setting("{$prefix}_theme_settings[featured_category]", array('default' => '', 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('featured_category', array('settings' => "{$prefix}_theme_settings[featured_category]", 'label' => esc_html__('Featured Category:', 'cakifo'), 'section' => 'cakifo_customize_settings', 'type' => 'select', 'choices' => $categories)); /** * Number of posts in the slider */ $wp_customize->add_setting("{$prefix}_theme_settings[featured_posts]", array('default' => 5, 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('featured_posts', array('settings' => "{$prefix}_theme_settings[featured_posts]", 'label' => esc_html__('Number of posts', 'cakifo'), 'section' => 'cakifo_customize_settings', 'type' => 'text')); if ($wp_customize->is_preview() && !is_admin()) { add_action('wp_footer', 'cakifo_customize_preview', 21); } }
/** * Registers custom sections, settings, and controls for the $wp_customize instance. * * @since 1.4.0 * @access private * @param object $wp_customize */ function hybrid_customize_register($wp_customize) { /* Get supported theme settings. */ $supports = get_theme_support('hybrid-core-theme-settings'); /* Get the theme prefix. */ $prefix = hybrid_get_prefix(); /* Get the default theme settings. */ $default_settings = hybrid_get_default_theme_settings(); /* Add the footer section, setting, and control if theme supports the 'footer' setting. */ if (is_array($supports[0]) && in_array('footer', $supports[0])) { /* Add the footer section. */ $wp_customize->add_section('hybrid-core-footer', array('title' => esc_html__('Footer', 'hybrid-core'), 'priority' => 200, 'capability' => 'edit_theme_options')); /* Add the 'footer_insert' setting. */ $wp_customize->add_setting("{$prefix}_theme_settings[footer_insert]", array('default' => $default_settings['footer_insert'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'hybrid_customize_sanitize', 'sanitize_js_callback' => 'hybrid_customize_sanitize', 'transport' => 'postMessage')); /* Add the textarea control for the 'footer_insert' setting. */ $wp_customize->add_control(new Hybrid_Customize_Control_Textarea($wp_customize, 'hybrid-core-footer', array('label' => esc_html__('Footer', 'hybrid-core'), 'section' => 'hybrid-core-footer', 'settings' => "{$prefix}_theme_settings[footer_insert]"))); /* If viewing the customize preview screen, add a script to show a live preview. */ if ($wp_customize->is_preview() && !is_admin()) { add_action('wp_footer', 'hybrid_customize_preview_script', 21); } } }