render_block_core_template_part_file
Fires when a block template part is loaded from a template part in the theme.
Использование
add_action( 'render_block_core_template_part_file', 'wp_kama_render_block_core_template_part_file_action', 10, 4 ); /** * Function for `render_block_core_template_part_file` action-hook. * * @param string $template_part_id The requested template part namespaced to the theme. * @param array $attributes The block attributes. * @param string $template_part_file_path Absolute path to the template path. * @param string $content The template part content. * * @return void */ function wp_kama_render_block_core_template_part_file_action( $template_part_id, $attributes, $template_part_file_path, $content ){ // action... }
- $template_part_id(строка)
- The requested template part namespaced to the theme.
- $attributes(массив)
- The block attributes.
- $template_part_file_path(строка)
- Absolute path to the template path.
- $content(строка)
- The template part content.
Список изменений
С версии 5.9.0 | Введена. |
Где вызывается хук
render_block_core_template_part_file
wp-includes/blocks/template-part.php 96
do_action( 'render_block_core_template_part_file', $template_part_id, $attributes, $template_part_file_path, $content );