Ticket #39623: 39623.diff
File 39623.diff, 2.7 KB (added by , 7 years ago) |
---|
-
wp-content/themes/twentyseventeen/functions.php
587 587 add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' ); 588 588 589 589 /** 590 * Modifies the Video Header to show the video everywhere if selected 591 * 592 * @param $active 593 * 594 * @return bool 595 */ 596 function twentyseventeen_video_header_everywhere( $active ) 597 { 598 $video_header_everywhere = get_theme_mod ( 'video_header_everywhere', 'no' ); 599 if ( is_front_page() ) { 600 return true; 601 } elseif ( 'no' === $video_header_everywhere && !is_front_page() ) { 602 return false; 603 } elseif ( 'yes' === $video_header_everywhere ) { 604 return true; 605 } 606 } 607 add_filter( 'is_header_video_active', 'twentyseventeen_video_header_everywhere' ); 608 609 /** 590 610 * Implement the Custom Header feature. 591 611 */ 592 612 require get_parent_theme_file_path( '/inc/custom-header.php' ); -
wp-content/themes/twentyseventeen/inc/customizer.php
143 143 'container_inclusive' => true, 144 144 ) 145 145 ); 146 147 $wp_customize->add_setting( 148 'video_header_everywhere', array( 149 'default' => 'no', 150 'sanitize_callback' => 'twentyseventeen_sanitize_video_header_everywhere', 151 'transport' => 'postMessage', 152 ) 153 ); 154 155 $wp_customize->add_control( 156 'video_header_everywhere', array( 157 'label' => __( 'Enable video header on all pages', 'twentyseventeen' ), 158 'section' => 'theme_options', 159 'type' => 'select', 160 'description' => __( 'When yes is selected your video header will play in all pages instead of a header image.', 'twentyseventeen' ), 161 'choices' => array( 162 'no' => __( 'No', 'twentyseventeen' ), 163 'yes' => __( 'Yes', 'twentyseventeen' ), 164 ) 165 ) 166 ); 146 167 } 147 168 } 148 169 add_action( 'customize_register', 'twentyseventeen_customize_register' ); … … 181 202 } 182 203 183 204 /** 205 * Sanitize the video header everywhere options. 206 * 207 * @param string $input Page layout. 208 */ 209 function twentyseventeen_sanitize_video_header_everywhere( $input ) { 210 $valid = array( 211 'no' => __( 'No', 'twentyseventeen' ), 212 'yes' => __( 'Yes', 'twentyseventeen' ), 213 ); 214 215 if ( array_key_exists( $input, $valid ) ) { 216 return $input; 217 } 218 219 return ''; 220 } 221 222 /** 184 223 * Render the site title for the selective refresh partial. 185 224 * 186 225 * @since Twenty Seventeen 1.0