mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Docs: Document the usage of $_wp_current_template_content global in a few block template functions.
Follow-up to [51003], [51149]. See #52628. git-svn-id: https://develop.svn.wordpress.org/trunk@51150 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user