Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_get_comments

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
245
246           $groupby = '';
247
248           $this->query_vars = wp_parse_args( $query_vars, $defaults );
249
250           // Parse meta query
251           $this->meta_query = new WP_Meta_Query();
252           $this->meta_query->parse_query_vars( $this->query_vars );
253
254           do_action_ref_array( 'pre_get_comments', array( &$this ) );
255           extract( $this->query_vars, EXTR_SKIP );
256
257           // $args can be whatever, only use the args defined in defaults to compute the key
258           $key = md5( serialize( compact(array_keys($defaults)) )  );
259           $last_changed = wp_cache_get( 'last_changed', 'comment' );
260           if ( ! $last_changed ) {
261                $last_changed = microtime();
262                wp_cache_set( 'last_changed', $last_changed, 'comment' );
263           }