[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> block-template.php (summary)

Block template loader functions.

File Size: 229 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  locate_block_template()
  resolve_block_template()
  _block_template_render_title_tag()
  get_the_block_template_html()
  _block_template_viewport_meta_tag()
  _strip_template_file_suffix()
  _block_template_render_without_post_block_context()

Functions
Functions that are not part of a class:

locate_block_template( $template, $type, array $templates )   X-Ref
Find a block template with equal or higher specificity than a given PHP template file.

Internally, this communicates the block content that needs to be used by the template canvas through a global variable.

return: string The path to the Full Site Editing template canvas file, or the fallback PHP template.
since: 5.8.0
param: string   $template  Path to the template. See locate_template().
param: string   $type      Sanitized filename without extension.
param: string[] $templates A list of template candidates, in descending order of priority.

resolve_block_template( $template_type, $template_hierarchy )   X-Ref
Return the correct 'wp_template' to render for the request template type.

return: WP_Block_Template|null template A template object, or null if none could be found.
since: 5.8.0
param: string   $template_type      The current template type.
param: string[] $template_hierarchy The current template hierarchy, ordered by priority.

_block_template_render_title_tag()   X-Ref
No description

get_the_block_template_html()   X-Ref
Returns the markup for the current template.

return: string Block template markup.
since: 5.8.0

_block_template_viewport_meta_tag()   X-Ref
Renders a 'viewport' meta tag.

This is hooked into {@see 'wp_head'} to decouple its output from the default template canvas.

since: 5.8.0

_strip_template_file_suffix( $template_file )   X-Ref
Strips .php or .html suffix from template file names.

return: string Template file name without extension.
since: 5.8.0
param: string $template_file Template file name.

_block_template_render_without_post_block_context( $context )   X-Ref
Removes post details from block context when rendering a block template.

return: array Filtered context.
since: 5.8.0
param: array $context Default context.



Generated: Thu Dec 2 01:00:03 2021 Cross-referenced by PHPXref 0.7.1