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
215                'post_id' => 0,
216                'status' => '',
217                'type' => '',
218                'user_id' => '',
219                'search' => '',
220                'count' => false
221           );
222
223           $this->query_vars = wp_parse_args( $query_vars, $defaults );
224           do_action_ref_array( 'pre_get_comments', array( &$this ) );
225           extract( $this->query_vars, EXTR_SKIP );
226
227           // $args can be whatever, only use the args defined in defaults to compute the key
228           $key = md5( serialize( compact(array_keys($defaults)) )  );
229           $last_changed = wp_cache_get('last_changed', 'comment');
230           if ( !$last_changed ) {
231                $last_changed = time();
232                wp_cache_set('last_changed', $last_changed, 'comment');
233           }