In `wp-includes/revision.php` - remove dead code:
* In `wp_get_post_autosave()`, `break` is unreachable after `return` * In `_wp_put_post_revision()`, `$post_id` is set then never used. See #27882. git-svn-id: https://develop.svn.wordpress.org/trunk@28334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
098a5145c5
commit
f63b6cde3a
|
@ -190,7 +190,6 @@ function wp_get_post_autosave( $post_id, $user_id = 0 ) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return $revision;
|
return $revision;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +253,6 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
|
||||||
if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
|
if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
|
||||||
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
|
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
|
||||||
|
|
||||||
$post_id = $post['ID'];
|
|
||||||
$post = _wp_post_revision_fields( $post, $autosave );
|
$post = _wp_post_revision_fields( $post, $autosave );
|
||||||
$post = wp_slash($post); //since data is from db
|
$post = wp_slash($post); //since data is from db
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue