add_section( 'affiliates_bloglet_special', array( 'title' => __('Affiliates Bloglet Customization','affiliates-bloglet'), 'priority' => 1, 'description' => __( 'These are child theme only feature', 'affiliates-bloglet' ), 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'affiliates_bloglet_readmore_bg', array( 'default' => '#fab526', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'affiliates_bloglet_readmore_bg', array( 'label' => __( 'Read More Button Background Color', 'affiliates-bloglet' ), 'section' => 'affiliates_bloglet_special', 'priority' => 1, 'description' => __( 'Read more button is shown on the blog feed.', 'affiliates-bloglet' ), 'settings' => 'affiliates_bloglet_readmore_bg', ) ) ); $wp_customize->add_setting( 'affiliates_bloglet_readmore_text', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'affiliates_bloglet_readmore_text', array( 'label' => __( 'Read More Button Text Color', 'affiliates-bloglet' ), 'section' => 'affiliates_bloglet_special', 'description' => __( 'Read more button is shown on the blog feed.', 'affiliates-bloglet' ), 'priority' => 1, 'settings' => 'affiliates_bloglet_readmore_text', ) ) ); $wp_customize->add_setting( 'affiliates_bloglet_abouttheauthor_color', array( 'default' => '#afafaf', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'affiliates_bloglet_abouttheauthor_color', array( 'label' => __( 'About The Author Text Color', 'affiliates-bloglet' ), 'section' => 'affiliates_bloglet_special', 'description' => __( 'About the author is shown on the blog feed and on single post.', 'affiliates-bloglet' ), 'priority' => 1, 'settings' => 'affiliates_bloglet_abouttheauthor_color', ) ) ); function affiliates_blogley_sanitize_radio( $input, $setting ){ $input = sanitize_key($input); $choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } $wp_customize->add_section( 'toggle_about_the_author', array( 'title' => __('Toggle About The Author','affiliates-bloglet'), 'description' => __('Show or hide "Written by Author" on blog feed and posts.', 'affiliates-bloglet'), 'priority' => 20, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting('toggle_about_the_author', array( 'sanitize_callback' => 'affiliates_blogley_sanitize_radio', 'default' => 'showauthor' )); $wp_customize->add_control( 'toggle_about_the_author', array( 'section' => 'affiliates_bloglet_special', 'label' => __( 'Show Post Author', 'affiliates-bloglet' ), 'type' => 'radio', 'priority' => 2, 'choices' => array( 'showauthor' => __('Show Author', 'affiliates-bloglet'), 'hideauthor' => __('Hide Author', 'affiliates-bloglet'), ), )); } add_action( 'customize_register', 'affiliates_bloglet_customize_register', 999 ); if(! function_exists('affiliates_bloglet_customize_register_output' ) ): function affiliates_bloglet_customize_register_output(){ ?> 'Reveal Buttons', 'slug' => 'coupon-reveal-button', 'required' => false, ), array( 'name' => 'Tables (SEO Optimized with Schema Markup)', 'slug' => 'superb-tables', 'required' => false, ), array( 'name' => 'Social Share and Follow Buttons', 'slug' => 'superb-social-share-and-follow-buttons', 'required' => false, ), ); $config = array( 'id' => 'affiliates-bloglet', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); }