Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #54910, comment 12


Ignore:
Timestamp:
01/27/2022 10:28:20 PM (2 years ago)
Author:
costdev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #54910, comment 12

    v1 v2  
    33**Edit**
    44Updated the patch to add a check for `wp_is_block_theme()` before running `locate_block_template()` to prevent "Empty template: Index" from being output on the frontend when `index.html` is empty.
     5
     6Note:
     7
     8- `if ( $content && ! empty( parse_blocks( $content ) ) {}` is overkill, as `(bool) array() === false`.
     9- `if ( $content && parse_blocks( $content ) ) {}` should be enough.
     10
     11I used the former to clearly indicate the intention, but this can be changed to the latter if preferred.