WordPress.org

Make WordPress Core

Changeset 1449


Ignore:
Timestamp:
06/30/2004 03:31:49 PM (14 years ago)
Author:
rboren
Message:

Add WP_Query_State class. Introduce is_single(), is_archive(), and friends.

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r1443 r1449  
    148148$query_string = apply_filters('query_string', $query_string);
    149149
     150$wp_query_state->parse_query($query_string);
     151
    150152// Update some caches.
    151153update_category_cache();
  • trunk/wp-includes/functions.php

    r1446 r1449  
    18061806}
    18071807
     1808function is_single () {
     1809    global $wp_query_state;
     1810
     1811    return $wp_query_state->single;
     1812}
     1813
     1814function is_archive () {
     1815    global $wp_query_state;
     1816
     1817    return $wp_query_state->archive;
     1818}
     1819
     1820function is_date () {
     1821    global $wp_query_state;
     1822
     1823    return $wp_query_state->date;
     1824}
     1825
     1826function is_author () {
     1827    global $wp_query_state;
     1828
     1829    return $wp_query_state->author;
     1830}
     1831
     1832function is_category () {
     1833    global $wp_query_state;
     1834
     1835    return $wp_query_state->category;
     1836}
     1837
     1838function is_search () {
     1839    global $wp_query_state;
     1840
     1841    return $wp_query_state->search;
     1842}
     1843
     1844function is_feed () {
     1845    global $wp_query_state;
     1846
     1847    return $wp_query_state->search;
     1848}
     1849
     1850function is_home () {
     1851    global $wp_query_state;
     1852
     1853    return $wp_query_state->home;
     1854}
     1855
    18081856?>
  • trunk/wp-settings.php

    r1441 r1449  
    4848
    4949
     50require (ABSPATH . WPINC . '/classes.php');
    5051require (ABSPATH . WPINC . '/functions.php');
    5152timer_start();
Note: See TracChangeset for help on using the changeset viewer.