Make WordPress Core

Changeset 56610

Timestamp:
09/18/2023 12:40:11 PM (11 months ago)
Author:
gziolo
Message:

Blocks: Introduce helper function to retrieve hooked blocks

In order to implement Block Hooks (see #59313), we added block_hooks field to the WP_Block_Type class, as well as to block registration related functions. In this follow-up, new helper function gets introduced that is going to compute the list of hooked blocks by other registered blocks for a given block type.

Extracted from https://github.com/WordPress/wordpress-develop/pull/5158 and covered with unit tests.

Props ockham.
Fixes #59383.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r56598 r56610  
    741741
    742742/**
     743
     744
     745
     746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
    743764 * Given an array of attributes, returns a string in the serialized attributes
    744765 * format prepared for post content.
Note: See TracChangeset for help on using the changeset viewer.