Opened 20 months ago
Last modified 8 months ago
#62593 new defect (bug)
Condition for doing_it_wrong for conditional tags is too generic
| Reported by: | kkmuffme | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
The condition for doing it wrong on conditionals is too generic, causing it to not trigger in many cases, e.g. is_search(),...
https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/query.php#L861
e.g. define WP_DEBUG true and add this to an (mu-)plugin and open a 404 or search page and you'll see that you won't get an error from _doing_it_wrong
<?php function test_conditionals() { if ( is_404() ) { wp_die( '404' ); } if ( is_search() ) { wp_die( 'search' ); } } add_action( 'setup_theme', 'test_conditionals' );
Change History (2)
This ticket was mentioned in PR #7905 on WordPress/wordpress-develop by @kkmuffme.
20 months ago
#1
- Keywords has-patch has-unit-tests added
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/62593