[wp-trac] [WordPress Trac] #59591: Missing checks for pattern files trigger (invisible) PHP warnings

WordPress Trac noreply at wordpress.org
Mon Oct 16 10:25:45 UTC 2023


#59591: Missing checks for pattern files trigger (invisible) PHP warnings
---------------------------------------+--------------------------
 Reporter:  afercia                    |       Owner:  flixos90
     Type:  defect (bug)               |      Status:  closed
 Priority:  normal                     |   Milestone:  6.4
Component:  Themes                     |     Version:  trunk
 Severity:  normal                     |  Resolution:  fixed
 Keywords:  has-screenshots has-patch  |     Focuses:  performance
---------------------------------------+--------------------------
Changes (by flixos90):

 * keywords:  has-screenshots has-patch 2nd-opinion dev-feedback => has-
     screenshots has-patch
 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 Replying to [comment:20 afercia]:
 > As a site owner, I'm not required to know what the WP_DEVELOPMENT_MODE
 constant is.

 That is correct. The WP_DEVELOPMENT_MODE constant is relevant only when
 developing on a WordPress site, either core, a plugin, or a theme. For
 theme developers though, it is crucial to be familiar with the constant.

 > I just want to upload a new pattern file to my directory and I'd expect
 it to just work.
 >
 > Actually, in this scenario, as a site owner I'm not even _editing_ the
 theme. I'm just uploading a new pattern file.

 In that case, you ''are'' developing/editing a theme. Adding a pattern to
 a theme, updating a pattern in a theme, editing theme.json, all of that is
 developing a theme.

 In order for your changes to be properly reflected while developing, you
 need to set the WP_DEVELOPMENT_MODE constant to "theme". See
 https://make.wordpress.org/core/2023/07/14/configuring-development-mode-
 in-6-3/

 > I'm pretty sure there are more scenarios that I can't think of right now
 that may be very confusing for users.

 Users can edit patterns in the UI, and that is not affected by the caching
 mechanisms. And it shouldn't, since doing so is not editing a theme.

 Note that all of this is conceptually not new. The WP_DEVELOPMENT_MODE
 constant was introduced in 6.3, largely for the very purpose it is used
 for here. Certain theme files have been cached even since 6.1. This ticket
 is not the place to discuss the higher-level concept behind the
 development mode. If you disagree with the concept, please open a separate
 ticket.

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


More information about the wp-trac mailing list