Changes between Version 11 and Version 21 of Ticket #52920
- Timestamp:
- 04/21/2021 08:33:58 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #52920 – Description
v11 v21 6 6 7 7 Changes included so far: 8 - `wp-format-library` assets are always loaded for the block editor with the corresponding hook 8 - new method `get_default_block_categories` were introduced to make is possible to share default block categories 9 - new method `get_allowed_block_types` was introduced to handle filters depending on the editor type 9 10 - most of the settings that are defined on the client in the block editor package in https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/store/defaults.js are already exposed from the new `get_default_block_editor_settings` method 11 - another method `get_block_editor_settings` got introduced to ensure that editor settings can be filtered depending on the editor type 10 12 - the logic that preloads common data used with the block editor by processing an array of REST API paths is now abstracted in `block_editor_preload_api_requests` method 11 13 12 14 All existing filters that depend on `$post` object get deprecated with `apply_filters_deprecated` as suggested by @jeremyfelt: 13 15 - `allowed_block_types` 16 - `block_categories` 14 17 - `block_editor_preload_paths` 15 - `block_ categories`18 - `block_editor_settings` 16 19 17 20 New filters are introduced that are context-aware: 21 - `allowed_block_types_all` 18 22 - `allowed_block_types_{$editor_name}` 23 - `block_categories_all` 19 24 - `block_editor_preload_paths_{$editor_name}` 20 - `block_categories_{$editor_name}` 25 - `block_editor_settings_all` 26 - `block_editor_settings_{$editor_name}` 27 28 In the case where there are two filters for a general use case that covers any editor type and a specific one, I followed #46187 and the implementation for `render_block` + `render_block_{$block_name}`. @johnbillion shared more examples in https://core.trac.wordpress.org/ticket/46187#comment:9: 29 30 > This is a fairly common pattern in core, see for example: `gettext/gettext_{$domain}`, `plugin_action_links/plugin_action_links_{$plugin_file}`, `manage_posts_columns/manage_{$post_type}_posts_columns`, etc. The dynamically named filter should come after the generic one.