diff options
Diffstat (limited to 'src/wp-includes/class-wp-customize-manager.php')
-rw-r--r-- | src/wp-includes/class-wp-customize-manager.php | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 51c88ef5fc..0d41d4a09b 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3165,27 +3165,25 @@ final class WP_Customize_Manager { return; } - if ( $changeset_post_id ) { - if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->delete_post, $changeset_post_id ) ) { - wp_send_json_error( - array( - 'code' => 'changeset_trash_unauthorized', - 'message' => __( 'Unable to trash changes.' ), - ) - ); - } + if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->delete_post, $changeset_post_id ) ) { + wp_send_json_error( + array( + 'code' => 'changeset_trash_unauthorized', + 'message' => __( 'Unable to trash changes.' ), + ) + ); + } - $lock_user = (int) wp_check_post_lock( $changeset_post_id ); + $lock_user = (int) wp_check_post_lock( $changeset_post_id ); - if ( $lock_user && get_current_user_id() !== $lock_user ) { - wp_send_json_error( - array( - 'code' => 'changeset_locked', - 'message' => __( 'Changeset is being edited by other user.' ), - 'lockUser' => $this->get_lock_user_data( $lock_user ), - ) - ); - } + if ( $lock_user && get_current_user_id() !== $lock_user ) { + wp_send_json_error( + array( + 'code' => 'changeset_locked', + 'message' => __( 'Changeset is being edited by other user.' ), + 'lockUser' => $this->get_lock_user_data( $lock_user ), + ) + ); } if ( 'trash' === get_post_status( $changeset_post_id ) ) { |