Make WordPress Core

Changeset 42543


Ignore:
Timestamp:
01/22/2018 07:09:16 PM (7 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r42536 r42543  
    79057905                editShortcutVisibility  = state.instance( 'editShortcutVisibility' ),
    79067906                changesetLocked = state.instance( 'changesetLocked' ),
    7907                 populateChangesetUuidParam;
     7907                populateChangesetUuidParam, defaultSelectedChangesetStatus;
    79087908
    79097909            state.bind( 'change', function() {
     
    79397939                            saveBtn.val( api.l10n.schedule );
    79407940                        }
    7941                     } else if ( ! api.settings.changeset.currentUserCanPublish ) {
    7942                         selectedChangesetStatus( 'draft' );
    7943                     } else {
     7941                    } else if ( api.settings.changeset.currentUserCanPublish ) {
    79447942                        saveBtn.val( api.l10n.publish );
    79457943                    }
     
    79637961            };
    79647962
     7963            defaultSelectedChangesetStatus = api.settings.changeset.currentUserCanPublish ? 'publish' : 'draft';
     7964
    79657965            // Set default states.
    79667966            changesetStatus( api.settings.changeset.status );
     
    79687968            changesetDate( api.settings.changeset.publishDate );
    79697969            selectedChangesetDate( api.settings.changeset.publishDate );
    7970             selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? 'publish' : api.settings.changeset.status );
     7970            selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? defaultSelectedChangesetStatus : api.settings.changeset.status );
    79717971            selectedChangesetStatus.link( changesetStatus ); // Ensure that direct updates to status on server via wp.customizer.previewer.save() will update selection.
    79727972            saved( true );
Note: See TracChangeset for help on using the changeset viewer.