Changeset 51168
- Timestamp:
- 06/16/2021 09:41:44 AM (3 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 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'] ) { -
trunk/src/wp-includes/class-wp-theme-json.php
r51152 r51168 1099 1099 $this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data ); 1100 1100 1101 // The array_replace_recursive algorithm merges at the leaf level. 1102 // For leaf values that are arrays it will use the numeric indexes for replacement. 1103 // In those cases, we want to replace the existing with the incoming value, if it exists. 1101 /* 1102 * The array_replace_recursive() algorithm merges at the leaf level. 1103 * For leaf values that are arrays it will use the numeric indexes for replacement. 1104 * In those cases, we want to replace the existing with the incoming value, if it exists. 1105 */ 1104 1106 $to_replace = array(); 1105 1107 $to_replace[] = array( 'custom' ); -
trunk/src/wp-includes/theme-templates.php
r51150 r51168 23 23 } 24 24 25 // Template slugs must be unique within the same theme. 26 // TODO - Figure out how to update this to work for a multi-theme 27 // environment. Unfortunately using `get_the_terms` for the 'wp-theme' 28 // term does not work in the case of new entities since is too early in 29 // the process to have been saved to the entity. So for now we use the 30 // currently activated theme for creation. 25 /* 26 * Template slugs must be unique within the same theme. 27 * TODO - Figure out how to update this to work for a multi-theme environment. 28 * Unfortunately using `get_the_terms()` for the 'wp-theme' term does not work 29 * in the case of new entities since is too early in the process to have been saved 30 * to the entity. So for now we use the currently activated theme for creation. 31 */ 31 32 $theme = wp_get_theme()->get_stylesheet(); 32 33 $terms = get_the_terms( $post_ID, 'wp_theme' );
Note: See TracChangeset
for help on using the changeset viewer.