pre_get_comments
Fires before comments are retrieved.
Usage
add_action( 'pre_get_comments', 'wp_kama_pre_get_comments_action' );
/**
* Function for `pre_get_comments` action-hook.
*
* @param WP_Comment_Query $query Current instance of WP_Comment_Query (passed by reference).
*
* @return void
*/
function wp_kama_pre_get_comments_action( $query ){
// action...
}
- $query(WP_Comment_Query)
- Current instance of WP_Comment_Query (passed by reference).
Changelog
| Since 3.1.0 | Introduced. |
Where the hook is called
wp-includes/class-wp-comment-query.php 394
do_action_ref_array( 'pre_get_comments', array( &$this ) );