[wp-trac] [WordPress Trac] #54910: 5.9 Bug - Blank Home Page

WordPress Trac noreply at wordpress.org
Wed Jan 26 15:54:59 UTC 2022


#54910: 5.9 Bug - Blank Home Page
--------------------------+------------------------------
 Reporter:  cantuaria     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:  5.9
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by costdev):

 One option is just to require the `full-site-editing` tag, or similar, in
 `style.css` as an explicit way to denote a block theme.

 Another way is a filter for `WP_Theme->is_block_theme()`. I submitted
 [https://github.com/WordPress/wordpress-develop/pull/2175/ PR 2175] for
 #54829 which implements an `is_block_theme` filter.

 If a legacy theme had `templates/index.html` along with
 `templates/some_php_file.php`, it could add the following:

 {{{#!php
 <?php

 add_filter( 'is_block_theme', '__return_false' );
 }}}

 Similarly, if a theme developer wanted to organise their folders
 differently, say `fse/page.html`, they could add the following filter to
 make sure `WP_Theme->is_block_theme()` still returned `true`:

 {{{#!php
 <?php

 add_filter( 'is_block_theme', '__return_true' );
 }}}


 ----

 ''Related train of thought''

 I don't know if there's currently a way to specify an alternative
 templates folder. Is this available?

 For example, what if someone wanted to organise their folders differently
 say, `site_templates/page.html`?

 If this is already possible, does the theme still need to have
 `templates/index.html` for `WP_Theme->is_block_theme()` to return `true`?

 If this isn't available, I don't believe there's any existing strict theme
 folder naming restrictions in Core and it would be beneficial to allow
 theme developers to organise their directories based on what suits them.
 That's a separate ticket in itself, but some food for thought when
 implementing a solution that allows theme developers to change the outcome
 of `WP_Theme->is_block_theme()` as needed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54910#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list