WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
345 | $metadata['file'] = wp_normalize_path( realpath( $metadata_file ) ); |
346 |
|
347 | /** |
348 | * Filters the metadata provided for registering a block type. |
349 | * |
350 | * @since 5.7.0 |
351 | * |
352 | * @param array $metadata Metadata for registering a block type. |
353 | */ |
354 | $metadata = apply_filters( 'block_type_metadata', $metadata ); |
355 |
|
356 | // Add `style` and `editor_style` for core blocks if missing. |
357 | if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) { |
358 | $block_name = str_replace( 'core/', '', $metadata['name'] ); |
359 |
|
360 | if ( ! isset( $metadata['style'] ) ) { |
361 | $metadata['style'] = "wp-block-$block_name"; |
362 | } |
363 | if ( ! isset( $metadata['editorStyle'] ) ) { |