[wp-trac] [WordPress Trac] #63212: Enhancement: Do not throw PHP notice when file is not a pattern registration file

WordPress Trac noreply at wordpress.org
Tue Apr 1 18:17:35 UTC 2025


#63212: Enhancement: Do not throw PHP notice when file is not a pattern
registration file
--------------------------+------------------------
 Reporter:  webmandesign  |       Owner:  joemcgill
     Type:  enhancement   |      Status:  reviewing
 Priority:  normal        |   Milestone:  6.8
Component:  Themes        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------

Comment (by webmandesign):

 Replying to [comment:8 joemcgill]:
 > I don't think we will want to remove the `_doing_it_wrong()` that you
 are suggesting, but perhaps we can develop a workaround to support
 organizing pattern files in your `/patterns` directory that should not be
 autoloaded.

 Well, that's pity :)

 In that case I would take some filter hook too. Such as providing a filter
 for [https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-
 includes/class-wp-theme.php#L1861 `$files` variable].

 (Or possibly even filtering for related [https://github.com/WordPress
 /wordpress-develop/blob/trunk/src/wp-includes/class-wp-theme.php#L1455
 `scandir()` method] output, or its `$path` variable value, so I can short
 circuit it.)

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


More information about the wp-trac mailing list