diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css
index 8b38aee..49b0ebb 100644
|
|
p.customize-section-description { |
1186 | 1186 | } |
1187 | 1187 | |
1188 | 1188 | /** |
| 1189 | * Header Video |
| 1190 | */ |
| 1191 | .header-video-not-currently-previewable { |
| 1192 | display: none; /* Visibility toggled by change to the header_video control's active state. */ |
| 1193 | } |
| 1194 | |
| 1195 | /** |
1189 | 1196 | * Themes |
1190 | 1197 | */ |
1191 | 1198 | |
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 17159a0..ab83468 100644
|
|
|
5284 | 5284 | } ); |
5285 | 5285 | } ); |
5286 | 5286 | |
| 5287 | // Toggle visibility of Header Video notice when active state change. |
| 5288 | api.control( 'header_video', function( headerVideoControl ) { |
| 5289 | headerVideoControl.deferred.embedded.done( function() { |
| 5290 | var toggleNotice = function() { |
| 5291 | var section = api.section( headerVideoControl.section() ), notice; |
| 5292 | if ( ! section ) { |
| 5293 | return; |
| 5294 | } |
| 5295 | notice = section.container.find( '.header-video-not-currently-previewable:first' ); |
| 5296 | if ( headerVideoControl.active.get() ) { |
| 5297 | notice.stop().slideUp( 'fast' ); |
| 5298 | } else { |
| 5299 | notice.stop().slideDown( 'fast' ); |
| 5300 | } |
| 5301 | }; |
| 5302 | toggleNotice(); |
| 5303 | headerVideoControl.active.bind( toggleNotice ); |
| 5304 | } ); |
| 5305 | } ); |
| 5306 | |
5287 | 5307 | // Update the setting validities. |
5288 | 5308 | api.previewer.bind( 'selective-refresh-setting-validities', function handleSelectiveRefreshedSettingValidities( settingValidities ) { |
5289 | 5309 | api._handleSettingValidities( { |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index 34aeba7..2b4498e 100644
|
|
final class WP_Customize_Manager { |
3407 | 3407 | |
3408 | 3408 | if ( current_theme_supports( 'custom-header', 'video' ) ) { |
3409 | 3409 | $title = __( 'Header Media' ); |
3410 | | $description = __( 'If you add a video, the image will be used as a fallback while the video loads.' ); |
| 3410 | $description = '<p>' . __( 'If you add a video, the image will be used as a fallback while the video loads.' ) . '</p>'; |
| 3411 | |
| 3412 | // @todo Customizer sections should support having notifications just like controls do. |
| 3413 | $description .= '<div class="customize-control-notifications-container header-video-not-currently-previewable"><ul>'; |
| 3414 | $description .= '<li class="notice notice-info">' . __( 'This theme doesn\'t support video headers on this page. Navigate to the front page or another page that does.' ) . '</li>'; |
| 3415 | $description .= '</ul></div>'; |
3411 | 3416 | $width = absint( get_theme_support( 'custom-header', 'width' ) ); |
3412 | 3417 | $height = absint( get_theme_support( 'custom-header', 'height' ) ); |
3413 | 3418 | if ( $width && $height ) { |
… |
… |
final class WP_Customize_Manager { |
3484 | 3489 | 'placeholder' => __( 'No video selected' ), |
3485 | 3490 | 'frame_title' => __( 'Select Video' ), |
3486 | 3491 | 'frame_button' => __( 'Choose Video' ), |
3487 | | ) |
| 3492 | ), |
| 3493 | 'active_callback' => 'is_front_page', |
3488 | 3494 | ) ) ); |
3489 | 3495 | |
3490 | 3496 | $this->add_control( 'external_header_video', array( |
… |
… |
final class WP_Customize_Manager { |
3492 | 3498 | 'type' => 'url', |
3493 | 3499 | 'description' => __( 'Or, enter a YouTube URL:' ), |
3494 | 3500 | 'section' => 'header_image', |
| 3501 | 'active_callback'=> 'is_front_page', |
3495 | 3502 | ) ); |
3496 | 3503 | |
3497 | 3504 | $this->add_control( new WP_Customize_Header_Image_Control( $this ) ); |