mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-18 16:45:31 +01:00
89a99dba2f
Enable the storing of post meta in revisions including autosaves and previews: Add a new argument `revisions_enabled` to the `register_meta` function which enables storing meta in revisions. Add a new `wp_post_revision_meta_keys` filter which developers can use to control which meta is revisioned - it passes an array of the meta keys with revisions enabled as well as the post type. Meta keys with revisions enabled are also stored for autosaves, and are restored when a revision or autosave is restored. In addition, meta values are now stored with the autosave revision used for previews. Changes to meta can now be previewed correctly without overwriting the published meta (see #20299) or passing data as a query variable, as the editor currently does to preview changes to the featured image. Changes to meta with revisions enabled are considered when determining if a new revision should be created. A new revision is created if the meta value has changed since the last revision. Revisions are now saved on the `wp_after_insert_post` hook instead of `post_updated`. The `wp_after_insert_post` action is fired after post meta has been saved by the REST API which enables attaching meta to the revision. To ensure backwards compatibility with existing action uses, `wp_save_post_revision_on_insert` function exits early if plugins have removed the previous `do_action( 'post_updated', 'wp_save_post_revision' )` call. Props: alexkingorg, johnbillion, markjaquith, WraithKenny, kovshenin, azaozz, tv-productions, p51labs, mattheu, mikeschroder, Mamaduka, ellatrix, timothyblynjacobs, jakemgold, bookwyrm, ryanduff, mintindeed, wonderboymusic, sanchothefat, westonruter, spacedmonkey, hellofromTonya, drewapicture, adamsilverstein, swisspiddy. Fixes #20564, #20299. Built from https://develop.svn.wordpress.org/trunk@56714 git-svn-id: http://core.svn.wordpress.org/trunk@56226 1a063a9b-81f0-0310-95a4-ce76da25c4cd |
||
---|---|---|
.. | ||
class-wp-rest-application-passwords-controller.php | ||
class-wp-rest-attachments-controller.php | ||
class-wp-rest-autosaves-controller.php | ||
class-wp-rest-block-directory-controller.php | ||
class-wp-rest-block-pattern-categories-controller.php | ||
class-wp-rest-block-patterns-controller.php | ||
class-wp-rest-block-renderer-controller.php | ||
class-wp-rest-block-types-controller.php | ||
class-wp-rest-blocks-controller.php | ||
class-wp-rest-comments-controller.php | ||
class-wp-rest-controller.php | ||
class-wp-rest-edit-site-export-controller.php | ||
class-wp-rest-global-styles-controller.php | ||
class-wp-rest-global-styles-revisions-controller.php | ||
class-wp-rest-menu-items-controller.php | ||
class-wp-rest-menu-locations-controller.php | ||
class-wp-rest-menus-controller.php | ||
class-wp-rest-navigation-fallback-controller.php | ||
class-wp-rest-pattern-directory-controller.php | ||
class-wp-rest-plugins-controller.php | ||
class-wp-rest-post-statuses-controller.php | ||
class-wp-rest-post-types-controller.php | ||
class-wp-rest-posts-controller.php | ||
class-wp-rest-revisions-controller.php | ||
class-wp-rest-search-controller.php | ||
class-wp-rest-settings-controller.php | ||
class-wp-rest-sidebars-controller.php | ||
class-wp-rest-site-health-controller.php | ||
class-wp-rest-taxonomies-controller.php | ||
class-wp-rest-templates-controller.php | ||
class-wp-rest-terms-controller.php | ||
class-wp-rest-themes-controller.php | ||
class-wp-rest-url-details-controller.php | ||
class-wp-rest-users-controller.php | ||
class-wp-rest-widget-types-controller.php | ||
class-wp-rest-widgets-controller.php |