Changeset 57020 for branches/6.4/src/wp-includes/block-template.php
- Timestamp:
- 10/27/2023 06:34:11 PM (12 months ago)
- Location:
- branches/6.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.4
-
branches/6.4/src/wp-includes/block-template.php
r56507 r57020 209 209 * @since 5.8.0 210 210 * 211 * @global string $_wp_current_template_id 211 212 * @global string $_wp_current_template_content 212 213 * @global WP_Embed $wp_embed … … 216 217 */ 217 218 function get_the_block_template_html() { 218 global $_wp_current_template_ content, $wp_embed, $wp_query;219 global $_wp_current_template_id, $_wp_current_template_content, $wp_embed, $wp_query; 219 220 220 221 if ( ! $_wp_current_template_content ) { … … 243 244 * loop, it would not cause errors since it would use a cloned instance and go through the same loop of a single 244 245 * post, within the actual main query loop. 246 * 247 * This special logic should be skipped if the current template does not come from the current theme, in which case 248 * it has been injected by a plugin by hijacking the block template loader mechanism. In that case, entirely custom 249 * logic may be applied which is unpredictable and therefore safer to omit this special handling on. 245 250 */ 246 if ( is_singular() && 1 === $wp_query->post_count && have_posts() ) { 251 if ( 252 $_wp_current_template_id && 253 str_starts_with( $_wp_current_template_id, get_stylesheet() . '//' ) && 254 is_singular() && 255 1 === $wp_query->post_count && 256 have_posts() 257 ) { 247 258 while ( have_posts() ) { 248 259 the_post();
Note: See TracChangeset
for help on using the changeset viewer.