X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4713a14935b83517997f3c88f808eb41da55033d..8ab4a4532479e8db471032b51042ec8c4716d091:/wp-content/themes/twentyfourteen/inc/customizer.php?ds=sidebyside diff --git a/wp-content/themes/twentyfourteen/inc/customizer.php b/wp-content/themes/twentyfourteen/inc/customizer.php index d40856d8..063d54c3 100644 --- a/wp-content/themes/twentyfourteen/inc/customizer.php +++ b/wp-content/themes/twentyfourteen/inc/customizer.php @@ -1,6 +1,6 @@ get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); - $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); - // Add postMessage support for site title and description. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; @@ -30,14 +26,24 @@ function twentyfourteen_customize_register( $wp_customize ) { // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'twentyfourteen' ); + // Add custom description to Colors and Background controls or sections. + if ( property_exists( $wp_customize->get_control( 'background_color' ), 'description' ) ) { + $wp_customize->get_control( 'background_color' )->description = __( 'May only be visible on wide screens.', 'twentyfourteen' ); + $wp_customize->get_control( 'background_image' )->description = __( 'May only be visible on wide screens.', 'twentyfourteen' ); + } else { + $wp_customize->get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); + $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); + } + // Add the featured content section in case it's not already there. $wp_customize->add_section( 'featured_content', array( - 'title' => __( 'Featured Content', 'twentyfourteen' ), - 'description' => sprintf( __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), + 'title' => __( 'Featured Content', 'twentyfourteen' ), + 'description' => sprintf( __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'edit.php?show_sticky=1' ) ), - 'priority' => 130, + 'priority' => 130, + 'active_callback' => 'is_front_page', ) ); // Add the featured content layout setting and control. @@ -75,7 +81,7 @@ function twentyfourteen_sanitize_layout( $layout ) { } /** - * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. + * Bind JS handlers to make Customizer preview reload changes asynchronously. * * @since Twenty Fourteen 1.0 */ @@ -100,8 +106,8 @@ function twentyfourteen_contextual_help() { 'content' => '', ) ); }