add_setting( 'front_page_title', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'sanitize_js_callback' => 'esc_html', ) ); $wp_customize->add_control( 'front_page_title', array( 'label' => esc_html__( 'Front page title', 'primer' ), 'section' => 'static_front_page', 'settings' => 'front_page_title', 'type' => 'text', 'active_callback' => array( $this, 'latest_posts_on_front_page' ), ) ); } /** * Check whether the front page is set to display the latest posts. * * @since 1.5.0 * * @return bool */ public function latest_posts_on_front_page() { return ( 'posts' === get_option( 'show_on_front' ) ); } } $GLOBALS['primer_static_front_page_options'] = new Primer_Static_Front_Page_Options;