render_block_core_template_part_post
Fires when a block template part is loaded from a template post stored in the database.
Usage
add_action( 'render_block_core_template_part_post', 'wp_kama_render_block_core_template_part_post_action', 10, 4 ); /** * Function for `render_block_core_template_part_post` action-hook. * * @param string $template_part_id The requested template part namespaced to the theme. * @param array $attributes The block attributes. * @param WP_Post $template_part_post The template part post object. * @param string $content The template part content. * * @return void */ function wp_kama_render_block_core_template_part_post_action( $template_part_id, $attributes, $template_part_post, $content ){ // action... }
- $template_part_id(string)
- The requested template part namespaced to the theme.
- $attributes(array)
- The block attributes.
- $template_part_post(WP_Post)
- The template part post object.
- $content(string)
- The template part content.
Changelog
Since 5.9.0 | Introduced. |
Where the hook is called
render_block_core_template_part_post
wp-includes/blocks/template-part.php 65
do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content );