mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Take revision control out of the realm of a pure constant. Make it filterable.
* New filter: wp_revisions_to_keep props ethitter, SergeyBiryukov. fixes #22289. git-svn-id: https://develop.svn.wordpress.org/trunk@23818 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3535,7 +3535,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
|
||||
|
||||
// Check if revisions are enabled.
|
||||
if ( ! WP_POST_REVISIONS || ! post_type_supports( $post->post_type, 'revisions' ) )
|
||||
if ( ! wp_revisions_enabled( $post ) )
|
||||
return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
|
||||
|
||||
$revisions = wp_get_post_revisions( $post_id );
|
||||
@@ -3602,7 +3602,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
|
||||
|
||||
// Check if revisions are disabled.
|
||||
if ( ! WP_POST_REVISIONS || ! post_type_supports( $post->post_type, 'revisions' ) )
|
||||
if ( ! wp_revisions_enabled( $post ) )
|
||||
return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
|
||||
|
||||
$post = wp_restore_post_revision( $revision_id );
|
||||
|
||||
Reference in New Issue
Block a user