From 7119126dc3afb936ae2e4004aa1b09dfb503daf7 Mon Sep 17 00:00:00 2001 From: oandregal Date: Thu, 11 May 2023 09:03:26 +0000 Subject: [PATCH] Docs: describe return type of `_get_block_template_file()`. Props: desrosj, mukesh27, costdev, johnbillion. Fixes #57756. Built from https://develop.svn.wordpress.org/trunk@55744 git-svn-id: http://core.svn.wordpress.org/trunk@55256 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-template-utils.php | 33 ++++++++++------------------ wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/wp-includes/block-template-utils.php b/wp-includes/block-template-utils.php index d6c2589c86..a34caff00d 100644 --- a/wp-includes/block-template-utils.php +++ b/wp-includes/block-template-utils.php @@ -249,7 +249,18 @@ function _get_block_templates_paths( $base_directory ) { * * @param string $template_type 'wp_template' or 'wp_template_part'. * @param string $slug Template slug. - * @return array|null Template. + * @return array|null { + * Array with template metadata if $template_type is one of 'wp_template' or 'wp_template_part'. + * null otherwise. + * + * @type string $slug Template slug. + * @type string $path Template file path. + * @type string $theme Theme slug. + * @type string $type Template type. + * @type string $area Template area. Only for 'wp_template_part'. + * @type string $title Optional. Template title. + * @type string[] $postTypes Optional. List of post types that the template supports. Only for 'wp_template'. + * } */ function _get_block_template_file( $template_type, $slug ) { if ( 'wp_template' !== $template_type && 'wp_template_part' !== $template_type ) { @@ -357,16 +368,6 @@ function _get_block_templates_files( $template_type, $query = array() ) { ); if ( 'wp_template_part' === $template_type ) { - /* - * Structure of a wp_template_part item: - * - * - slug - * - path - * - theme - * - type - * - area - * - title (optional) - */ $candidate = _add_block_template_part_area_info( $new_template_item ); if ( ! isset( $area ) || ( isset( $area ) && $area === $candidate['area'] ) ) { $template_files[] = $candidate; @@ -374,16 +375,6 @@ function _get_block_templates_files( $template_type, $query = array() ) { } if ( 'wp_template' === $template_type ) { - /* - * Structure of a wp_template item: - * - * - slug - * - path - * - theme - * - type - * - title (optional) - * - postTypes (optional) - */ $candidate = _add_block_template_info( $new_template_item ); if ( ! $post_type || diff --git a/wp-includes/version.php b/wp-includes/version.php index 2ffd1c4d1c..a6027519d9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55743'; +$wp_version = '6.3-alpha-55744'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.