Make WordPress Core

Changeset 56674


Ignore:
Timestamp:
09/25/2023 09:12:08 AM (16 months ago)
Author:
Bernhard Reiter
Message:

Blocks: Remove inject_hooked_block_markup filter.

Per discussion in #59424, there's agreement that the new hooked_block_types filter (introduced in [56673]) covers conditional addition and removal of hooked blocks better and at a higher level than the inject_hooked_block_markup filter that was originally added in [56649] for that same purpose.
Consequently, this changeset removes the latter filter.

Props gziolo.
Fixes #59439.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r56673 r56674  
    819819            $hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context );
    820820            foreach ( $hooked_block_types as $hooked_block_type ) {
    821                 $hooked_block_markup = get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    822                 /** This filter is documented in wp-includes/blocks.php */
    823                 $markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $parent, $context );
     821                $markup .= get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    824822            }
    825823        }
     
    831829        $hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context );
    832830        foreach ( $hooked_block_types as $hooked_block_type ) {
    833             $hooked_block_markup = get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    834             /**
    835              * Filters the serialized markup of a hooked block.
    836              *
    837              * @since 6.4.0
    838              *
    839              * @param string                  $hooked_block_markup The serialized markup of the hooked block.
    840              * @param string                  $hooked_block_type   The type of the hooked block.
    841              * @param string                  $relative_position   The relative position of the hooked block.
    842              *                                                     Can be one of 'before', 'after', 'first_child', or 'last_child'.
    843              * @param array                   $block               The anchor block.
    844              * @param WP_Block_Template|array $context             The block template, template part, or pattern that the anchor block belongs to.
    845              */
    846             $markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $block, $context );
     831            $markup .= get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    847832        }
    848833
     
    886871        $hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context );
    887872        foreach ( $hooked_block_types as $hooked_block_type ) {
    888             $hooked_block_markup = get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    889             /** This filter is documented in wp-includes/blocks.php */
    890             $markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $block, $context );
     873            $markup .= get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    891874        }
    892875
     
    899882            $hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context );
    900883            foreach ( $hooked_block_types as $hooked_block_type ) {
    901                 $hooked_block_markup = get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    902                 /** This filter is documented in wp-includes/blocks.php */
    903                 $markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $parent, $context );
     884                $markup .= get_comment_delimited_block_content( $hooked_block_type, array(), '' );
    904885            }
    905886        }
Note: See TracChangeset for help on using the changeset viewer.