Changeset 41603
- Timestamp:
- 09/26/2017 08:32:46 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r41597 r41603 5511 5511 wp_customize: 'on', 5512 5512 customize_theme: api.settings.theme.stylesheet, 5513 customize_changeset_uuid: api.settings.changeset. latestAutoDraftUuid || api.settings.changeset.uuid,5513 customize_changeset_uuid: api.settings.changeset.uuid, 5514 5514 nonce: api.settings.nonce.dismiss_autosave 5515 5515 } ); -
trunk/src/wp-includes/class-wp-customize-manager.php
r41597 r41603 3055 3055 3056 3056 $changeset_post_id = $this->changeset_post_id(); 3057 if ( empty( $changeset_post_id ) ) { 3058 wp_send_json_error( 'missing_changeset', 404 ); 3059 } 3060 3061 if ( 'auto-draft' === get_post_status( $changeset_post_id ) ) { 3062 if ( ! update_post_meta( $changeset_post_id, '_customize_restore_dismissed', true ) ) { 3063 wp_send_json_error( 'auto_draft_dismissal_failure', 500 ); 3057 3058 if ( empty( $changeset_post_id ) || 'auto-draft' === get_post_status( $changeset_post_id ) ) { 3059 $changeset_autodraft_posts = $this->get_changeset_posts( array( 3060 'post_status' => 'auto-draft', 3061 'exclude_restore_dismissed' => true, 3062 'posts_per_page' => -1, 3063 ) ); 3064 $dismissed = 0; 3065 foreach ( $changeset_autodraft_posts as $autosave_autodraft_post ) { 3066 if ( $autosave_autodraft_post->ID === $changeset_post_id ) { 3067 continue; 3068 } 3069 if ( update_post_meta( $autosave_autodraft_post->ID, '_customize_restore_dismissed', true ) ) { 3070 $dismissed++; 3071 } 3072 } 3073 if ( $dismissed > 0 ) { 3074 wp_send_json_success( 'auto_draft_dismissed' ); 3064 3075 } else { 3065 wp_send_json_ success( 'auto_draft_dismissed');3076 wp_send_json_error( 'no_autosave_to_delete', 404 ); 3066 3077 } 3067 3078 } else {
Note: See TracChangeset
for help on using the changeset viewer.