Changeset 51168 for trunk/src/wp-includes/block-template.php
- Timestamp:
- 06/16/2021 09:41:44 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template.php
r51150 r51168 24 24 25 25 if ( $template ) { 26 // locate_template() has found a PHP template at the path specified by $template. 27 // That means that we have a fallback candidate if we cannot find a block template 28 // with higher specificity. 29 // Thus, before looking for matching block themes, we shorten our list of candidate 30 // templates accordingly. 26 /* 27 * locate_template() has found a PHP template at the path specified by $template. 28 * That means that we have a fallback candidate if we cannot find a block template 29 * with higher specificity. 30 * 31 * Thus, before looking for matching block themes, we shorten our list of candidate 32 * templates accordingly. 33 */ 31 34 32 35 // Locate the index of $template (without the theme directory path) in $templates. … … 219 222 function _block_template_render_without_post_block_context( $context ) { 220 223 /* 221 * When loading a template directly and not through a page 222 * that resolves it, the top-level post ID and type context get set to that 223 * of the template. Templates are just the structure of a site, and 224 * they should not be available as post context because blocks like Post 225 * Content would recurse infinitely. 224 * When loading a template directly and not through a page that resolves it, 225 * the top-level post ID and type context get set to that of the template. 226 * Templates are just the structure of a site, and they should not be available 227 * as post context because blocks like Post Content would recurse infinitely. 226 228 */ 227 229 if ( isset( $context['postType'] ) && 'wp_template' === $context['postType'] ) {
Note: See TracChangeset
for help on using the changeset viewer.