add_section( 'bright_blog_author_section', array( 'panel' => 'bright_blog_front_page_options', 'title' => esc_html__( 'Author Section', 'bright-blog' ), ) ); // Author Section - Enable Section. $wp_customize->add_setting( 'bright_blog_enable_author_section', array( 'default' => false, 'sanitize_callback' => 'bright_blog_sanitize_switch', ) ); $wp_customize->add_control( new Bright_Blog_Toggle_Switch_Custom_Control( $wp_customize, 'bright_blog_enable_author_section', array( 'label' => esc_html__( 'Enable Author Section', 'bright-blog' ), 'section' => 'bright_blog_author_section', 'settings' => 'bright_blog_enable_author_section', ) ) ); if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'bright_blog_enable_author_section', array( 'selector' => '#bright_blog_author_section .section-link', 'settings' => 'bright_blog_enable_author_section', ) ); } // Author Section - Background Image. $wp_customize->add_setting( 'bright_blog_author_section_background_image', array( 'sanitize_callback' => 'bright_blog_sanitize_image', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bright_blog_author_section_background_image', array( 'label' => esc_html__( 'Background Image', 'bright-blog' ), 'section' => 'bright_blog_author_section', 'settings' => 'bright_blog_author_section_background_image', 'active_callback' => 'bright_blog_is_author_section_enabled', ) ) ); // Author Section - Image. $wp_customize->add_setting( 'bright_blog_author_image', array( 'sanitize_callback' => 'bright_blog_sanitize_image', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bright_blog_author_image', array( 'label' => esc_html__( 'Author Image', 'bright-blog' ), 'section' => 'bright_blog_author_section', 'settings' => 'bright_blog_author_image', 'active_callback' => 'bright_blog_is_author_section_enabled', ) ) ); // Author Section - Introduction Text. $wp_customize->add_setting( 'bright_blog_author_introduction_text', array( 'default' => __( 'Hi, I am Jane Doe', 'bright-blog' ), 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'bright_blog_author_introduction_text', array( 'label' => esc_html__( 'Introduction Text', 'bright-blog' ), 'section' => 'bright_blog_author_section', 'settings' => 'bright_blog_author_introduction_text', 'type' => 'text', 'active_callback' => 'bright_blog_is_author_section_enabled', ) ); // Author Section - Short Description. $wp_customize->add_setting( 'bright_blog_author_short_description', array( 'default' => __( 'I am a writer based in California', 'bright-blog' ), 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( 'bright_blog_author_short_description', array( 'label' => esc_html__( 'Short Description', 'bright-blog' ), 'section' => 'bright_blog_author_section', 'settings' => 'bright_blog_author_short_description', 'type' => 'textarea', 'active_callback' => 'bright_blog_is_author_section_enabled', ) ); // Author Section - Social Links. $wp_customize->add_setting( 'bright_blog_author_social_links', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new Bright_Blog_Sortable_Repeater_Custom_Control( $wp_customize, 'bright_blog_author_social_links', array( 'label' => esc_html__( 'Social Icons', 'bright-blog' ), 'section' => 'bright_blog_author_section', 'button_labels' => array( 'add' => __( 'Add', 'bright-blog' ), ), 'active_callback' => 'bright_blog_is_author_section_enabled', ) ) );