Make WordPress Core


Ignore:
Timestamp:
12/04/2013 10:08:59 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: minor code cleanup in Customizer file, props obenland. Fixes #26414.

File:
1 edited

Legend:

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

    r26636 r26643  
    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
    1822    // Add postMessage support for site title and description.
    1923    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
     
    2125    $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    2226
     27    // Rename the label to "Site Title Color" because this only effects the site title in this theme.
     28    $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' );
     29
    2330    // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
    24     $wp_customize->add_control( 'display_header_text', array(
    25         'settings' => 'header_textcolor',
    26         'label'    => __( 'Display Site Title & Tagline', 'twentyfourteen' ),
    27         'section'  => 'title_tagline',
    28         'type'     => 'checkbox',
    29     ) );
    30 
    31     // Rename the label to "Site Title Color" because this only effects the site title in this theme.
    32     $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_textcolor', array(
    33         'label'   => __( 'Site Title Color', 'twentyfourteen' ),
    34         'section' => 'colors',
    35     ) ) );
    36 
    37     // Add custom description to Colors and Background sections.
    38     $wp_customize->get_section( 'colors' )->description           = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
    39     $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
     31    $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'twentyfourteen' );
    4032
    4133    // Add the featured content section in case it's not already there.
     
    7365 */
    7466function twentyfourteen_sanitize_layout( $layout ) {
    75     if ( ! in_array( $layout, array( 'grid', 'slider' ) ) )
     67    if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) {
    7668        $layout = 'grid';
     69    }
    7770
    7871    return $layout;
Note: See TracChangeset for help on using the changeset viewer.