From b16654400f8a0a58daddc7237b075974114c6733 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 3 Oct 2014 08:42:39 +0000 Subject: [PATCH] Twenty Fourteen: Move custom description for background color and image from sections to controls in the customizer. props jb510. fixes #29490. git-svn-id: https://develop.svn.wordpress.org/trunk@29827 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyfourteen/inc/customizer.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/wp-content/themes/twentyfourteen/inc/customizer.php b/src/wp-content/themes/twentyfourteen/inc/customizer.php index d40856d87c..ccfb2f545b 100644 --- a/src/wp-content/themes/twentyfourteen/inc/customizer.php +++ b/src/wp-content/themes/twentyfourteen/inc/customizer.php @@ -15,10 +15,6 @@ * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function twentyfourteen_customize_register( $wp_customize ) { - // Add custom description to Colors and Background sections. - $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 postMessage support for site title and description. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; @@ -30,6 +26,15 @@ 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' ),