wppaste
WordPress

do_action( 'render_block_core_template_part_post', string $template_part_id, array $attributes, WP_Post $template_part_post, string $content )

Since
5.9.0
Fires when a block template part is loaded from a template post stored in the database.

Compatibility

WordPress
since 5.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$template_part_idstring
The requested template part namespaced to the theme.
$attributesarray
The block attributes.
$template_part_postWP_Post
The template part post object.
$contentstring
The template part content.

Where this hook fires · 1

  • wp-includes/blocks/template-part.php:65render_block_core_template_part()

Source code

			 *			 * @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.			 */			do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content );		} else {			$template_part_file_path = '';			// Else, if the template part was provided by the active theme,			// render the corresponding file content.			if ( 0 === validate_file( $attributes['slug'] ) ) {				$block_template = get_block_file_template( $template_part_id, 'wp_template_part' );

Changelog

Introduced in 5.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.