Opened 2 months ago
Last modified 2 months ago
#62593 new defect (bug)
Condition for doing_it_wrong for conditional tags is too generic
Reported by: | kkmuffme | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
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.
2 months ago
#1
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/62593