Make WordPress Core

Ticket #26408: 26408.2.patch

File 26408.2.patch, 1.2 KB (added by kwight, 11 years ago)
  • wp-content/themes/twentyfourteen/inc/customizer.php

     
    4747
    4848        // Add the featured content layout setting and control.
    4949        $wp_customize->add_setting( 'featured_content_layout', array(
    50                 'default' => 'grid',
     50                'default'           => 'grid',
     51                'sanitize_callback' => 'twentyfourteen_sanitize_layout',
    5152        ) );
    5253
    5354        $wp_customize->add_control( 'featured_content_layout', array(
     
    6364add_action( 'customize_register', 'twentyfourteen_customize_register' );
    6465
    6566/**
     67 * Sanitize the Featured Content layout value.
     68 *
     69 * @since Twenty Fourteen 1.0
     70 *
     71 * @param string $layout The layout passed in from the Customizer
     72 * @return string The sanitized layout value
     73 */
     74function twentyfourteen_sanitize_layout( $layout ) {
     75        if ( ! in_array( $layout, array( 'grid', 'slider' ) ) )
     76                $layout = 'grid';
     77
     78        return $layout;
     79}
     80
     81/**
    6682 * Bind JS handlers to make Theme Customizer preview reload changes asynchronously.
    6783 *
    6884 * @since Twenty Fourteen 1.0