WordPress.org

Make WordPress Core

Ticket #38778: 38778.notification.diff

File 38778.notification.diff, 3.5 KB (added by westonruter, 3 years ago)
  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index 17159a0..4661017 100644
     
    52845284                        } );
    52855285                } );
    52865286
     5287                // Toggle visibility of Header Video notice when active state change.
     5288                api.control( 'header_image', 'header_video', function( headerImageControl, headerVideoControl ) {
     5289                        var toggleNotice = function() {
     5290                                var code = 'header_video_unpreviewable', notification;
     5291                                if ( ! headerVideoControl.active.get() && ! headerImageControl.notifications.has( code ) ) {
     5292                                        notification = new api.Notification( code, { message: api.l10n.headerVideoNotice, type: 'info' } );
     5293                                        headerImageControl.notifications.add( code, notification );
     5294                                } else if ( headerVideoControl.active.get() && headerImageControl.notifications.has( code ) ) {
     5295                                        headerImageControl.notifications.remove( code );
     5296                                }
     5297                        };
     5298                        headerVideoControl.active.bind( toggleNotice );
     5299                        toggleNotice();
     5300                } );
     5301
    52875302                // Update the setting validities.
    52885303                api.previewer.bind( 'selective-refresh-setting-validities', function handleSelectiveRefreshedSettingValidities( settingValidities ) {
    52895304                        api._handleSettingValidities( {
  • src/wp-includes/class-wp-customize-manager.php

    diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
    index 34aeba7..9f411d3 100644
    final class WP_Customize_Manager { 
    34073407
    34083408                if ( current_theme_supports( 'custom-header', 'video' ) ) {
    34093409                        $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                        $description .= '<p class="header-video-not-currently-previewable notice notice-info">' . __( 'Note: This theme doesn\'t support video headers on this page. Navigate to the front page or another page that does.' ) . '</p>';
    34113412                        $width = absint( get_theme_support( 'custom-header', 'width' ) );
    34123413                        $height = absint( get_theme_support( 'custom-header', 'height' ) );
    34133414                        if ( $width && $height ) {
    final class WP_Customize_Manager { 
    34843485                                'placeholder'  => __( 'No video selected' ),
    34853486                                'frame_title'  => __( 'Select Video' ),
    34863487                                'frame_button' => __( 'Choose Video' ),
    3487                         )
     3488                        ),
     3489                        'active_callback' => 'is_front_page',
    34883490                ) ) );
    34893491
    34903492                $this->add_control( 'external_header_video', array(
    final class WP_Customize_Manager { 
    34923494                        'type'           => 'url',
    34933495                        'description'    => __( 'Or, enter a YouTube URL:' ),
    34943496                        'section'        => 'header_image',
     3497                        'active_callback'=> 'is_front_page',
    34953498                ) );
    34963499
    34973500                $this->add_control( new WP_Customize_Header_Image_Control( $this ) );
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index fadfb28..9ad7f90 100644
    function wp_default_scripts( &$scripts ) { 
    472472                'untitledBlogName'   => __( '(Untitled)' ),
    473473                // Used for overriding the file types allowed in plupload.
    474474                'allowedFiles'       => __( 'Allowed Files' ),
     475                'headerVideoNotice'  => __( 'Note: This theme doesn\'t support video headers on this page. Navigate to the front page or another page that does.' ),
    475476        ) );
    476477        $scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );
    477478