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.

Built from https://develop.svn.wordpress.org/trunk@30091


git-svn-id: http://core.svn.wordpress.org/trunk@30091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn
2014-10-29 19:02:21 +00:00
parent 9a16b52018
commit a866a7192f
4 changed files with 40 additions and 3 deletions

View File

@@ -92,7 +92,18 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
);
}
}
return $return;
/**
* Filter the fields displayed in the post revision diff UI.
*
* @since 4.1.0
*
* @param array $return Revision UI fields. Each item is an array of id, name and diff.
* @param WP_Post $compare_from The revision post to compare from.
* @param WP_Post $compare_to The revision post to compare to.
*/
return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );
}
/**