From aba17cd9ea80256b8e6b4aa42ee2134afce95ab8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Jun 2021 10:21:57 +0000 Subject: [PATCH] Docs: Document the usage of `$_wp_current_template_content` global in a few block template functions. Follow-up to [51003], [51149]. See #52628. Built from https://develop.svn.wordpress.org/trunk@51150 git-svn-id: http://core.svn.wordpress.org/trunk@50759 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-template.php | 7 ++++++- wp-includes/theme-templates.php | 4 +++- wp-includes/version.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/wp-includes/block-template.php b/wp-includes/block-template.php index c93a083472..1a879c1670 100644 --- a/wp-includes/block-template.php +++ b/wp-includes/block-template.php @@ -12,6 +12,8 @@ * * @since 5.8.0 * + * @global string $_wp_current_template_content + * * @param string $template Path to the template. See locate_template(). * @param string $type Sanitized filename without extension. * @param array $templates A list of template candidates, in descending order of priority. @@ -147,7 +149,10 @@ function _block_template_render_title_tag() { * @access private * @since 5.8.0 * - * @return string block tempate markup. + * @global string $_wp_current_template_content + * @global WP_Embed $wp_embed + * + * @return string Block template markup. */ function get_the_block_template_html() { global $_wp_current_template_content; diff --git a/wp-includes/theme-templates.php b/wp-includes/theme-templates.php index 6c9da23b1b..d380951e38 100644 --- a/wp-includes/theme-templates.php +++ b/wp-includes/theme-templates.php @@ -72,9 +72,12 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID * @access private * @since 5.8.0 * + * @global string $_wp_current_template_content + * * @return void */ function the_block_template_skip_link() { + global $_wp_current_template_content; // Early exit if not a block theme. if ( ! current_theme_supports( 'block-templates' ) ) { @@ -82,7 +85,6 @@ function the_block_template_skip_link() { } // Early exit if not a block template. - global $_wp_current_template_content; if ( ! $_wp_current_template_content ) { return; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2827aa3023..753b68ac8b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta1-51149'; +$wp_version = '5.8-beta1-51150'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.