[wp-trac] [WordPress Trac] #55195: Calling `::parent()` on a child theme object where parent theme is missing `index.php` returns false in WP5.9

WordPress Trac noreply at wordpress.org
Mon Feb 21 10:28:40 UTC 2022


#55195: Calling `::parent()` on a child theme object where parent theme is missing
`index.php` returns false in WP5.9
--------------------------+---------------------
 Reporter:  robdxw        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.9.2
Component:  Themes        |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by robdxw):

 @azouamauriac There is one logic change in the commit I linked to, that
 seems to be the source of the issue. The function isn't just renamed, its
 implementation has been altered as well.

 Before:

 {{{#!php
 <?php
 function wp_is_block_template_theme() {
         return is_readable( get_theme_file_path( '/block-
 templates/index.html' ) ) ||
                 is_readable( get_theme_file_path( '/templates/index.html'
 ) );
 }
 }}}

 After:

 {{{#!php
 <?php
 function wp_is_block_theme() {
         return wp_get_theme()->is_block_theme();
 }
 }}}

 If I replace the contents of `wp_is_block_theme()` with the contents of
 `wp_is_block_template_theme()`, the previous behaviour is restored.

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


More information about the wp-trac mailing list