get_block_file_template
get_block_file_template
Appears in: gutenberg.11.0.0, gutenberg.11.1.0, gutenberg.11.2.0, gutenberg.11.2.1, gutenberg.11.3.0, gutenberg.11.4.0, gutenberg.11.4.1, gutenberg.11.5.0, gutenberg.11.5.1, gutenberg.11.6.0, gutenberg.11.7.1, gutenberg.11.8.0, gutenberg.12.7.2, gutenberg.12.9.0, gutenberg.13.1.0, gutenberg.13.2.0, gutenberg.13.4.0, gutenberg.13.5.0, gutenberg.13.5.2, gutenberg.13.6.0, wordpress-5.9, wordpress-5.9.1, wordpress-5.9.2, wordpress-5.9.3, wordpress-6.0, wordpress-6.0.1, wordpress-6.0.2, wordpress-6.0.3, wordpress-6.1, wordpress-6.1.1, wordpress-6.2, wordpress-6.2.1, wordpress-6.2.2, wordpress-6.3, wordpress-6.3.1, wordpress-6.3.2, wordpress-6.4, wordpress-6.4.1, wordpress-6.4.2, wordpress-6.4.3, wordpress-6.5, wordpress-6.5.2, wordpress-6.5.3, wordpress-6.5.4, wordpress-6.5.5, wordpress-6.6, wordpress-6.6.1, wordpress-6.6.2, wordpress-6.7, wordpress-6.7.1, wordpress-6.7.2
Hook Type: filter
See hook in action
Displaying hooks found in version: wordpress-6.7.2apply_filters('get_block_file_template') is found 3 times:
- /wp-includes/block-template-utils.php line 1318
$parts = explode( ‘//’, $id, 2 );
if ( count( $parts ) < 2 ) { /** This filter is documented in wp-includes/block-template-utils.php */ return apply_filters( 'get_block_file_template', null, $id, $template_type ); } list( $theme, $slug ) = $parts; if ( get_stylesheet() === $theme ) { $template_file = _get_block_template_file( $template_type, $slug ); if ( null !== $template_file ) { [/php] - /wp-includes/block-template-utils.php line 132813241325132613271328132913301331133213331334
if
( null !==
$template_file
) {
$block_template
= _build_block_template_result_from_file(
$template_file
,
$template_type
);
/** This filter is documented in wp-includes/block-template-utils.php */
return
apply_filters(
'get_block_file_template'
,
$block_template
,
$id
,
$template_type
);
}
}
$block_template
= WP_Block_Templates_Registry::get_instance()->get_by_slug(
$slug
);
/**
- /wp-includes/block-template-utils.php line 134313391340134113421343134413451346134713481349
* @param WP_Block_Template|null
$block_template
The found block template,
or
null
if
there is none.
* @param string
$id
Template unique identifier (example:
'theme_slug//template_slug'
).
* @param string
$template_type
Template type. Either
'wp_template'
or
'wp_template_part'
.
*/
return
apply_filters(
'get_block_file_template'
,
$block_template
,
$id
,
$template_type
);
}
/**
* Prints a block template part.
*
* @since 5.9.0