WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 406 | * @since 5.3.0 |
| 407 | * @since 5.6.0 The returned array of comment data is assigned to the `comments` property |
| 408 | * of the current WP_Comment_Query instance. |
| 409 | * |
| 410 | * @param array|int|null $comment_data Return an array of comment data to short-circuit WP's comment query, |
| 411 | * the comment count as an integer if `$this->query_vars['count']` is set, |
| 412 | * or null to allow WP to run its normal queries. |
| 413 | * @param WP_Comment_Query $query The WP_Comment_Query instance, passed by reference. |
| 414 | */ |
| 415 | $comment_data = apply_filters_ref_array( 'comments_pre_query', array( $comment_data, &$this ) ); |
| 416 | |
| 417 | if ( null !== $comment_data ) { |
| 418 | if ( is_array( $comment_data ) && ! $this->query_vars['count'] ) { |
| 419 | $this->comments = $comment_data; |
| 420 | } |
| 421 | |
| 422 | return $comment_data; |
| 423 | } |
| 424 | |