mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Introduce some actions and filters which aid plugins in revisioning post meta.
* `wp_save_post_revision_post_has_changed` filter which can be used to determine if a post has been changed, and therefore if a revision should be created for a post. * `wp_get_revision_ui_diff` filter which can be used to filter the fields displayed in the post revision diff UI. * `wp_creating_autosave` action which is fired just before an autosave is created. See #20564. Props mattheu, adamsilverstein. git-svn-id: https://develop.svn.wordpress.org/trunk@30091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1541,6 +1541,15 @@ function wp_create_post_autosave( $post_data ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires before an autosave is stored.
|
||||
*
|
||||
* @since 4.1.0
|
||||
*
|
||||
* @param array $new_autosave Post array - the autosave that is about to be saved.
|
||||
*/
|
||||
do_action( 'wp_creating_autosave', $new_autosave );
|
||||
|
||||
return wp_update_post( $new_autosave );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user