mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
8648d06284
This changeset adds a new `rest_pre_insert_{$this->post_type}` filter in the `WP_REST_Templates_Controller`, where it is applied to the return value of the `prepare_item_for_database` method. (This is consistent with the `WP_REST_Post_Controller`, where that filter has existed before.) The new filter is then used to inject hooked blocks into the template (or template part) content received via the endpoint, prior to persisting it to the database. This supersedes the previous mechanism, which was using the `rest_after_insert_{$this->post_type}` ''action'', from which it performed an additional `wp_update_post` call to update the template (part) content with the hooked blocks injected. The new technique eschews that additional call and the resulting extra revision it created, as well as a problem with regard to duplicated escaping and sanitization, which had caused some special characters to be garbled. Props tomjcafferkey, gziolo, swissspidy, karolmanijak. Fixes #60671. Built from https://develop.svn.wordpress.org/trunk@57790 git-svn-id: http://core.svn.wordpress.org/trunk@57291 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-font-collections-controller.php | ||
class-wp-rest-font-faces-controller.php | ||
class-wp-rest-font-families-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-template-autosaves-controller.php | ||
class-wp-rest-template-revisions-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 |