Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: parse_query

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
78                $this->init();
79                parse_str($query, $qv);
80                $this->query = $query;
81                $this->query_vars = $qv;
82           }
83
84           if ('404' == $qv['error']) {
85                $this->is_404 = true;
86                if ( !empty($query) ) {
87                     do_action('parse_query', array(&$this));
88                }
89                return;
90           }
91
92           $qv['m'] =  (int) $qv['m'];
93           $qv['p'] =  (int) $qv['p'];
94
95           // Compat.  Map subpost to attachment.
96           if ( '' != $qv['subpost'] )
 
Line Code
235           if (strstr($_SERVER['PHP_SELF'], 'wp-admin/')) {
236                $this->is_admin = true;
237           }
238
239           if ( ! ($this->is_attachment || $this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_comments_popup)) {
240                $this->is_home = true;
241           }
242
243           if ( !empty($query) ) {
244                do_action('parse_query', array(&$this));
245           }
246      }
247
248      function set_404() {
249           $is_feed = $this->is_feed;
250
251           $this->init_query_flags();
252           $this->is_404 = true;
253