﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
14494,"Move the is_*() (aka conditional tags, conditional functions) functionality into the WP_Query class",mdawaffe,,"The {{{is_*()}}} convenience functions only work for the {{{global $wp_query}}} object.

In particular, they don't tell you anything about the current query while in hooks like {{{pre_get_post}}}.

Attached moves their definitions to the {{{WP_Query}}} class so that you can do things like {{{->is_author()}}} on the current {{{global $wp_query}}} on the main {{{global $wp_the_query}}} and on the currently running query in filters like {{{pre_get_post}}} (all of which can be different in certain scenarios).

For example:

{{{
function my_query_mod( &$query ) {
  global $wp_the_query;
  // On the front page and doing an is_author sub or supplemental loop
  if ( $wp_the_query->is_front_page() && $query->is_author( 'bob' ) ) {
    // do something
  }
}
}}}

I think this is a piece of the puzzle in making the {{{WP}}} class hooks ({{{request}}}, {{{parse_request}}}) and the {{{WP_Query}}} hooks ({{{pre_get_posts}}}, etc.) all more useful and easier to use.

The attached also:

 1. Cleans up the inline docs.
 2. Deprecates {{{is_plugin_page()}}} which looks useless with the advent of the various hooks based off of {{{get_plugin_page_hookname()}}}.

Note:

I moved all the {{{is_*()}}} functions to be methods of {{{WP_Query}}}, but there's some we could probably keep as is.  {{{is_trackback()}}}, {{{is_robots()}}}, and {{{is_comments_popup()}}} probably don't need to be accessible on any query but the main one from the {{{WP}}} class.",enhancement,closed,normal,3.1,Query,3.0.1,normal,fixed,has-patch,mikeschinkel@…
