Make WordPress Core

Changeset 18699


Ignore:
Timestamp:
09/17/2011 08:46:35 PM (14 years ago)
Author:
nacin
Message:

is_main_query(). fixes #18677.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r18639 r18699  
    714714
    715715    return $wp_query->is_404();
     716}
     717
     718/**
     719 * Is the query the main query?
     720 *
     721 * @since 3.3.0
     722 *
     723 * @return bool
     724 */
     725function is_main_query() {
     726    global $wp_query;
     727    return $wp_query->is_main_query();
    716728}
    717729
     
    34683480        return (bool) $this->is_404;
    34693481    }
     3482
     3483    /**
     3484     * Is the query the main query?
     3485     *
     3486     * @since 3.3.0
     3487     *
     3488     * @return bool
     3489     */
     3490    function is_main_query() {
     3491        global $wp_the_query;
     3492        return $wp_the_query === $this;
     3493    }
    34703494}
    34713495
Note: See TracChangeset for help on using the changeset viewer.