[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
Sun Sep 1 00:57:18 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 squarespace):

 In `default-filters.php`, you can use conditionals to apply filters based
 on specific contexts, such as `is_admin()`, `is_singular()`,
 `current_user_can()`, or `is_page()`. This allows you to target filters
 for different areas of the site, user roles, or content types. Avoid
 modifying core files directly; instead, use custom plugins or your theme’s
 `functions.php` for customizations.

-- 
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