Changes between Version 1 and Version 2 of Ticket #54910, comment 12
- Timestamp:
- 01/27/2022 10:28:20 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #54910, comment 12
v1 v2 3 3 **Edit** 4 4 Updated 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 6 Note: 7 8 - `if ( $content && ! empty( parse_blocks( $content ) ) {}` is overkill, as `(bool) array() === false`. 9 - `if ( $content && parse_blocks( $content ) ) {}` should be enough. 10 11 I used the former to clearly indicate the intention, but this can be changed to the latter if preferred.