mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 07:36:58 +00:00
Customize: Fix confusion related to visibility of Themes panel with drafted/scheduled changesets.
* Prevent autoloading an existing draft/future changeset when theme not active. * Add missing notifications container to Themes panel. * Remove deactivation of themes panel when selected status is not publish. * Show notification in Themes panel when themes cannot be previewed and disable preview buttons. * Reject installTheme call when theme preview not available. * Return promise from installTheme and eliminate use of global events in favor of promises. Props westonruter, melchoyce, zoonini. See #37661, #39896. Fixes #42126. git-svn-id: https://develop.svn.wordpress.org/trunk@41788 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -607,7 +607,7 @@ final class WP_Customize_Manager {
|
||||
if ( empty( $this->_changeset_uuid ) ) {
|
||||
$changeset_uuid = null;
|
||||
|
||||
if ( ! $this->branching() ) {
|
||||
if ( ! $this->branching() && $this->is_theme_active() ) {
|
||||
$unpublished_changeset_posts = $this->get_changeset_posts( array(
|
||||
'post_status' => array_diff( get_post_stati(), array( 'auto-draft', 'publish', 'trash', 'inherit', 'private' ) ),
|
||||
'exclude_restore_dismissed' => false,
|
||||
|
||||
@@ -88,6 +88,8 @@ class WP_Customize_Themes_Panel extends WP_Customize_Panel {
|
||||
</div>
|
||||
<# } #>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="customize-control-notifications-container"></div>
|
||||
</li>
|
||||
<li class="customize-themes-full-container-container">
|
||||
<div class="customize-themes-full-container">
|
||||
|
||||
@@ -580,7 +580,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'trashConfirm' => __( 'Are you sure you’d like to discard your unpublished changes?' ),
|
||||
/* translators: %s: URL to the Customizer to load the autosaved version */
|
||||
'autosaveNotice' => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ),
|
||||
'videoHeaderNotice' => __( 'This theme doesn\'t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
|
||||
'videoHeaderNotice' => __( 'This theme doesn’t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
|
||||
// Used for overriding the file types allowed in plupload.
|
||||
'allowedFiles' => __( 'Allowed Files' ),
|
||||
'customCssError' => wp_array_slice_assoc(
|
||||
@@ -595,6 +595,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
array( 'singular', 'plural' )
|
||||
),
|
||||
'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
|
||||
'themePreviewUnavailable' => __( 'Sorry, you can’t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),
|
||||
) );
|
||||
$scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user