Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comments_clauses

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
370                $groupby = "{$wpdb->comments}.comment_ID";
371           }
372
373           if ( ! empty( $date_query ) && is_array( $date_query ) ) {
374                $date_query_object = new WP_Date_Query( $date_query, 'comment_date' );
375                $where .= $date_query_object->get_sql();
376           }
377
378           $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' );
379           $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
380           foreach ( $pieces as $piece )
381                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
382
383           if ( $groupby )
384                $groupby = 'GROUP BY ' . $groupby;
385
386           $query = "SELECT $fields FROM $wpdb->comments $join WHERE $where $groupby ORDER BY $orderby $order $limits";
387
388           if ( $count )