get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->add_section( 'fortress_theme_options', array( 'title' => esc_html__( 'Theme Options', 'fortress' ), 'priority' => 130, ) ); /* Header Featured section title */ $wp_customize->add_setting( 'fortress_featured_title', array( 'default' => esc_html__( 'Featured', 'fortress' ), 'sanitize_callback' => 'fortress_sanitize_text', ) ); $wp_customize->add_control( 'fortress_featured_title', array( 'label' => esc_html__( 'Featured content title', 'fortress' ), 'section' => 'fortress_theme_options', 'type' => 'text', ) ); /* Previous Posts title */ $wp_customize->add_setting( 'fortress_previous_title', array( 'default' => esc_html__( 'Previous articles', 'fortress' ), 'sanitize_callback' => 'fortress_sanitize_text', ) ); $wp_customize->add_control( 'fortress_previous_title', array( 'label' => esc_html__( 'Previous articles title', 'fortress' ), 'section' => 'fortress_theme_options', 'type' => 'text', ) ); } add_action( 'customize_register', 'fortress_customize_register' ); /** * Sanitize the text input. * * @param string $input. * * @return string $input. */ function fortress_sanitize_text( $input ) { return esc_html( $input ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function fortress_customize_preview_js() { wp_enqueue_script( 'fortress_customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'fortress_customize_preview_js' );