Make WordPress Core


Ignore:
Timestamp:
09/19/2017 05:39:37 AM (7 years ago)
Author:
westonruter
Message:

Customize: Add notifications API to sections and panels.

  • Adds a notifications property to instances of wp.customize.Panel and wp.customize.Section.
  • Adds a setupNotifications() method to Panel, Section, and Control.
  • Adds a getNotificationsContainerElement() method to the Panel and Section classes, like Control has.
  • Replace hard-coded notification in header media section with a notification.
  • Limit rendering notifications to panels and sections that are expanded, and to controls that have an expanded section.

See #34893, #35210, #38778.
Fixes #38794.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r41388 r41390  
    39293929            $description = '<p>' . __( 'If you add a video, the image will be used as a fallback while the video loads.' ) . '</p>';
    39303930
    3931             // @todo Customizer sections should support having notifications just like controls do. See <https://core.trac.wordpress.org/ticket/38794>.
    3932             $description .= '<div class="customize-control-notifications-container header-video-not-currently-previewable" style="display: none"><ul>';
    3933             $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 supports video headers.' ) . '</li>';
    3934             $description .= '</ul></div>';
    39353931            $width = absint( get_theme_support( 'custom-header', 'width' ) );
    39363932            $height = absint( get_theme_support( 'custom-header', 'height' ) );
Note: See TracChangeset for help on using the changeset viewer.