WordPress.org

Make WordPress Core

Changeset 2190


Ignore:
Timestamp:
02/01/2005 08:34:19 AM (17 years ago)
Author:
rboren
Message:

Add parse_query_vars() and parse_query action.

File:
1 edited

Legend:

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

    r2187 r2190  
    5757    }
    5858
     59    // Reparse the query vars.
     60    function parse_query_vars() {
     61        $this->parse_query('');
     62    }
     63
     64    // Parse a query string and set query type booleans.
    5965    function parse_query ($query) {
    60         $this->init();
    61         parse_str($query, $qv);
    62         $this->query = $query;
    63         $this->query_vars = $qv;
     66        if ( !empty($query) || !isset($this->query) ) {
     67            $this->init();
     68            parse_str($query, $qv);
     69            $this->query = $query;
     70            $this->query_vars = $qv;
     71        }
     72
    6473        $qv['m'] =  (int) $qv['m'];
    6574        $qv['p'] =  (int) $qv['p'];
     
    185194        if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin)) {
    186195            $this->is_home = true;
     196        }
     197
     198        if ( !empty($query) ) {
     199            do_action('parse_query', array(&$this));
    187200        }
    188201    }
Note: See TracChangeset for help on using the changeset viewer.