Changeset 42615 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 01/30/2018 12:20:37 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r42612 r42615 1142 1142 $this->_changeset_data = array(); 1143 1143 } else { 1144 if ( $this->autosaved() ) {1144 if ( $this->autosaved() && is_user_logged_in() ) { 1145 1145 $autosave_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); 1146 1146 if ( $autosave_post ) { … … 2903 2903 $r = wp_update_post( wp_slash( $post_array ), true ); 2904 2904 2905 // Delete autosave revision when the changeset is updated. 2906 $autosave_draft = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); 2907 if ( $autosave_draft ) { 2908 wp_delete_post( $autosave_draft->ID, true ); 2905 // Delete autosave revision for user when the changeset is updated. 2906 if ( ! empty( $args['user_id'] ) ) { 2907 $autosave_draft = wp_get_post_autosave( $changeset_post_id, $args['user_id'] ); 2908 if ( $autosave_draft ) { 2909 wp_delete_post( $autosave_draft->ID, true ); 2910 } 2909 2911 } 2910 2912 } … … 3549 3551 */ 3550 3552 public function handle_dismiss_autosave_or_lock_request() { 3553 // Calls to dismiss_user_auto_draft_changesets() and wp_get_post_autosave() require non-zero get_current_user_id(). 3554 if ( ! is_user_logged_in() ) { 3555 wp_send_json_error( 'unauthenticated', 401 ); 3556 } 3557 3551 3558 if ( ! $this->is_preview() ) { 3552 3559 wp_send_json_error( 'not_preview', 400 ); … … 4650 4657 if ( ! $this->saved_starter_content_changeset && ! $this->autosaved() ) { 4651 4658 if ( $changeset_post_id ) { 4652 $autosave_revision_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); 4659 if ( is_user_logged_in() ) { 4660 $autosave_revision_post = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); 4661 } 4653 4662 } else { 4654 4663 $autosave_autodraft_posts = $this->get_changeset_posts(
Note: See TracChangeset
for help on using the changeset viewer.