wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
get_hooked_blocks › WordPress Function
Od6.4.0
Przestarzałyn/a
› get_hooked_blocks ( Brak parametrów )
| Powrót: |
|
| Zdefiniowane na: |
|
| Codex: |
Retrieves block types hooked into the given block, grouped by anchor block type and the relative position.
Powiązane Funkcje: insert_hooked_blocks, get_allowed_block_types, get_dashboard_blog, set_ignored_hooked_blocks_metadata, do_blocks
Źródło
function get_hooked_blocks() {
$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
$hooked_blocks = array();
foreach ( $block_types as $block_type ) {
if ( ! ( $block_type instanceof WP_Block_Type ) || ! is_array( $block_type->block_hooks ) ) {
continue;
}
foreach ( $block_type->block_hooks as $anchor_block_type => $relative_position ) {
$hooked_blocks[ $anchor_block_type ][ $relative_position ][] = $block_type->name;
}
}
return $hooked_blocks;
}