WordPress.org

Make WordPress Core

Changeset 29827


Ignore:
Timestamp:
10/03/2014 08:42:39 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Twenty Fourteen: Move custom description for background color and image from sections to controls in the customizer.

props jb510.
fixes #29490.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php

    r27661 r29827  
    1616 */
    1717function twentyfourteen_customize_register( $wp_customize ) {
    18     // Add custom description to Colors and Background sections.
    19     $wp_customize->get_section( 'colors' )->description           = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
    20     $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
    21 
    2218    // Add postMessage support for site title and description.
    2319    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
     
    3026    // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
    3127    $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'twentyfourteen' );
     28
     29    // Add custom description to Colors and Background controls or sections.
     30    if ( property_exists( $wp_customize->get_control( 'background_color' ), 'description' ) ) {
     31        $wp_customize->get_control( 'background_color' )->description = __( 'May only be visible on wide screens.', 'twentyfourteen' );
     32        $wp_customize->get_control( 'background_image' )->description = __( 'May only be visible on wide screens.', 'twentyfourteen' );
     33    } else {
     34        $wp_customize->get_section( 'colors' )->description           = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
     35        $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
     36    }
    3237
    3338    // Add the featured content section in case it's not already there.
Note: See TracChangeset for help on using the changeset viewer.