VIP-Coding-Standards
VIP-Coding-Standards copied to clipboard
Flag missing `include_children = false` on tax queries
Please provide some more context here, such as example code that should be reported, and example code that shouldn't.
See https://vip.wordpress.com/documentation/term-queries-should-consider-include_children-false/
Example code:
$args = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'people',
'field' => 'slug',
'terms' => 'bob',
),
),
);
$query = new WP_Query( $args );
I think we already have some query-related Sniffs, or maybe WPCS has.