Docs: Synchronize some comments in wp-admin/revision.php.

See #49572.
Built from https://develop.svn.wordpress.org/trunk@48624


git-svn-id: http://core.svn.wordpress.org/trunk@48386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-07-26 20:43:02 +00:00
parent 33b3ea7bfe
commit a6cf8df9d1
2 changed files with 5 additions and 4 deletions

View File

@ -47,13 +47,13 @@ switch ( $action ) {
break; break;
} }
// Restore if revisions are enabled or this is an autosave. // Don't restore if revisions are disabled and this is not an autosave.
if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) { if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
$redirect = 'edit.php?post_type=' . $post->post_type; $redirect = 'edit.php?post_type=' . $post->post_type;
break; break;
} }
// Don't allow revision restore when post is locked. // Don't restore if the post is locked.
if ( wp_check_post_lock( $post->ID ) ) { if ( wp_check_post_lock( $post->ID ) ) {
break; break;
} }
@ -61,6 +61,7 @@ switch ( $action ) {
check_admin_referer( "restore-post_{$revision->ID}" ); check_admin_referer( "restore-post_{$revision->ID}" );
wp_restore_post_revision( $revision->ID ); wp_restore_post_revision( $revision->ID );
$redirect = add_query_arg( $redirect = add_query_arg(
array( array(
'message' => 5, 'message' => 5,
@ -86,7 +87,7 @@ switch ( $action ) {
break; break;
} }
// Revisions disabled and we're not looking at an autosave. // Bail if revisions are disabled and this is not an autosave.
if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) { if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
$redirect = 'edit.php?post_type=' . $post->post_type; $redirect = 'edit.php?post_type=' . $post->post_type;
break; break;

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-beta3-48623'; $wp_version = '5.5-beta3-48624';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.