render_block_core_template_part_file action-hookWP 5.9.0

Fires when a block template part is loaded from a template part in the theme.

Usage

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(string)
The requested template part namespaced to the theme.
$attributes(array)
The block attributes.
$template_part_file_path(string)
Absolute path to the template path.
$content(string)
The template part content.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

render_block_core_template_part()
render_block_core_template_part_file
wp-includes/blocks/template-part.php 90
do_action( 'render_block_core_template_part_file', $template_part_id, $attributes, $template_part_file_path, $content );

Where the hook is used in WordPress

Usage not found.