mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-31 21:48:36 +01:00
Customize: Let default status for Customizer be draft
if user does not have capability to publish
.
Amends [41626]. Props sayedwp, westonruter. See #30937. Fixes #42686 for 4.9 branch. Built from https://develop.svn.wordpress.org/branches/4.9@42544 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
385f70dc96
commit
db02fcb8f8
@ -7931,7 +7931,7 @@
|
||||
previewerAlive = state.instance( 'previewerAlive' ),
|
||||
editShortcutVisibility = state.instance( 'editShortcutVisibility' ),
|
||||
changesetLocked = state.instance( 'changesetLocked' ),
|
||||
populateChangesetUuidParam;
|
||||
populateChangesetUuidParam, defaultSelectedChangesetStatus;
|
||||
|
||||
state.bind( 'change', function() {
|
||||
var canSave;
|
||||
@ -7965,9 +7965,7 @@
|
||||
} else {
|
||||
saveBtn.val( api.l10n.schedule );
|
||||
}
|
||||
} else if ( ! api.settings.changeset.currentUserCanPublish ) {
|
||||
selectedChangesetStatus( 'draft' );
|
||||
} else {
|
||||
} else if ( api.settings.changeset.currentUserCanPublish ) {
|
||||
saveBtn.val( api.l10n.publish );
|
||||
}
|
||||
closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel );
|
||||
@ -7989,12 +7987,14 @@
|
||||
return status;
|
||||
};
|
||||
|
||||
defaultSelectedChangesetStatus = api.settings.changeset.currentUserCanPublish ? 'publish' : 'draft';
|
||||
|
||||
// Set default states.
|
||||
changesetStatus( api.settings.changeset.status );
|
||||
changesetLocked( Boolean( api.settings.changeset.lockUser ) );
|
||||
changesetDate( api.settings.changeset.publishDate );
|
||||
selectedChangesetDate( api.settings.changeset.publishDate );
|
||||
selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? 'publish' : api.settings.changeset.status );
|
||||
selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? defaultSelectedChangesetStatus : api.settings.changeset.status );
|
||||
selectedChangesetStatus.link( changesetStatus ); // Ensure that direct updates to status on server via wp.customizer.previewer.save() will update selection.
|
||||
saved( true );
|
||||
if ( '' === changesetStatus() ) { // Handle case for loading starter content.
|
||||
|
4
wp-admin/js/customize-controls.min.js
vendored
4
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9.3-alpha-42542';
|
||||
$wp_version = '4.9.3-alpha-42544';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user