Skip to content

Commit

Permalink
Rename to inject_ignored_hooked_blocks_metadata_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Feb 13, 2024
1 parent 3c9aa4b commit 51832fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ function get_template_hierarchy( $slug, $is_custom = false, $template_prefix = '
* @param WP_Post $post A post object with post type set to `wp_template` or `wp_template_part`.
* @return WP_Post The updated post object.
*/
function set_ignored_hooked_blocks_metadata_upon_rest_insert( $post ) {
function inject_ignored_hooked_blocks_metadata_attributes( $post ) {
$hooked_blocks = get_hooked_blocks();
if ( empty( $hooked_blocks ) && ! has_filter( 'hooked_block_types' ) ) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@

// It might be nice to use a filter instead of an action, but the `WP_REST_Templates_Controller` doesn't
// provide one (unlike e.g. `WP_REST_Posts_Controller`, which has `rest_pre_insert_{$this->post_type}`).
add_action( 'rest_after_insert_wp_template', 'set_ignored_hooked_blocks_metadata_upon_rest_insert', 10, 3 );
add_action( 'rest_after_insert_wp_template_part', 'set_ignored_hooked_blocks_metadata_upon_rest_insert', 10, 3 );
add_action( 'rest_after_insert_wp_template', 'inject_ignored_hooked_blocks_metadata_attributes', 10, 3 );
add_action( 'rest_after_insert_wp_template_part', 'inject_ignored_hooked_blocks_metadata_attributes', 10, 3 );

unset( $filter, $action );

0 comments on commit 51832fe

Please sign in to comment.