Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: posts_where

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

Line Code
2140                if ( ! isset($q['meta_compare']) || empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
2141                     $q['meta_compare'] = '=';
2142
2143                $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_value {$q['meta_compare']} %s ", $q['meta_value']);
2144           }
2145
2146           // Apply filters on where and join prior to paging so that any
2147           // manipulations to them are reflected in the paging by day queries.
2148           if ( !$q['suppress_filters'] ) {
2149                $where = apply_filters('posts_where', $where);
2150                $join = apply_filters('posts_join', $join);
2151           }
2152
2153           // Paging
2154           if ( empty($q['nopaging']) && !$this->is_singular ) {
2155                $page = absint($q['paged']);
2156                if (empty($page)) {
2157                     $page = 1;
2158                }