wpseo_pre_schema_block_type_(block_type)
Filter: 'wpseo_pre_schema_block_type_<block-type>' - Allows hooking things to change graph output based on the blocks on the page.
Использование
add_action( 'wpseo_pre_schema_block_type_(block_type)', 'wp_kama_wpseo_pre_schema_block_type_action', 10, 2 );
/**
* Function for `wpseo_pre_schema_block_type_(block_type)` action-hook.
*
* @param WP_Block_Parser_Block[] $blocks All the blocks of this block type.
* @param Meta_Tags_Context $context A value object with context variables.
*
* @return void
*/
function wp_kama_wpseo_pre_schema_block_type_action( $blocks, $context ){
// action...
}
- $blocks(WP_Block_Parser_Block[])
- All the blocks of this block type.
- $context(Meta_Tags_Context)
- A value object with context variables.
Где вызывается хук
wpseo_pre_schema_block_type_(block_type)
yoast/src/generators/schema-generator.php 60
\do_action( 'wpseo_pre_schema_block_type_' . $block_type, $context->blocks[ $block_type ], $context );