This may be a poor question but inside pre_get_posts()
is there any real difference between $query->conditional()
versus just adding the conditional()
? Take the following example:
/** Themes Pre Get Posts **/
function theme_pgp( $query ) {
if( $query->is_home() ) {
// Run Conditional 1
}
if( is_home() ) {
// Run Conditional 2
}
}
add_action( 'pre_get_posts', 'theme_pgp' );
For readability I prefer to use the second conditional but I often see code use the first so my question is: inside the pre_get_posts
function / action / filter - is there ever a case where this may return different results, meaning 1 conditional runs but not the other?