From 2b2f1fd885a6bf948ef5ca83229951f59ceea99d Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Tue, 4 Oct 2022 04:27:33 +0000 Subject: [PATCH] Docs: Correct docblocks for `get_block_file_template()`. This corrects the docblock for `get_block_file_template()` and the filters it contains: `pre_get_block_file_template` and `get_block_file_template`. Prior to this change they were incorrectly documented with the docblocks for `get_block_template()` and its associated filters. Props felipeelia. Fixes #55929. git-svn-id: https://develop.svn.wordpress.org/trunk@54380 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-template-utils.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index 78dac3724e..543cdaf629 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -1059,7 +1059,9 @@ function get_block_template( $id, $template_type = 'wp_template' ) { } /** - * Retrieves a single unified template object using its id. + * Retrieves a unified template object based on a theme file. + * + * This is a fallback of get_block_template(), used when no templates are found in the database. * * @since 5.9.0 * @@ -1070,9 +1072,9 @@ function get_block_template( $id, $template_type = 'wp_template' ) { */ function get_block_file_template( $id, $template_type = 'wp_template' ) { /** - * Filters the block templates array before the query takes place. + * Filters the block template object before the theme file discovery takes place. * - * Return a non-null value to bypass the WordPress queries. + * Return a non-null value to bypass the WordPress theme file discovery. * * @since 5.9.0 * @@ -1107,7 +1109,7 @@ function get_block_file_template( $id, $template_type = 'wp_template' ) { $block_template = _build_block_template_result_from_file( $template_file, $template_type ); /** - * Filters the array of queried block templates array after they've been fetched. + * Filters the block template object after it has been (potentially) fetched from the theme file. * * @since 5.9.0 *