[wp-trac] [WordPress Trac] #38650: Provide some guidance on what conditionals can/should be used in default-filters.php

WordPress Trac noreply at wordpress.org
Mon Sep 23 08:34:50 UTC 2024


#38650: Provide some guidance on what conditionals can/should be used in default-
filters.php
----------------------------+---------------------
 Reporter:  helen           |       Owner:  jorbin
     Type:  enhancement     |      Status:  closed
 Priority:  low             |   Milestone:  6.7
Component:  Bootstrap/Load  |     Version:
 Severity:  minor           |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:  docs
----------------------------+---------------------

Comment (by younis7788):

 Thanks for your feedback! You’re spot on about the confusion surrounding
 the functions available in default-filters.php. Many developers can
 struggle with understanding the load order and what’s safe to use.

 I completely agree that an inline comment at the top would be beneficial.
 It could outline the purpose of the file and specify which functions from
 load.php are safe to use. This would provide clarity for anyone diving
 into the code and help prevent issues stemming from using unsupported
 functions like get_option() or is_customize_preview().

 Additionally, it might be helpful to include a brief explanation of the
 loading process in WordPress, so developers can get a clearer picture of
 when and where certain functions can be utilized. We could also consider
 adding references to documentation or resources for deeper understanding.

 Thanks again for bringing this up! It’s all about making the codebase more
 accessible and user-friendly.

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


More information about the wp-trac mailing list