ActionScheduler_wpCommentLogger::filter_comment_queries()
Method of the class: ActionScheduler_wpCommentLogger{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger(); $ActionScheduler_wpCommentLogger->filter_comment_queries( $query );
- $query(WP_Comment_Query) (required)
- -
ActionScheduler_wpCommentLogger::filter_comment_queries() ActionScheduler wpCommentLogger::filter comment queries code WC 9.3.3
public function filter_comment_queries( $query ) { foreach ( array('ID', 'parent', 'post_author', 'post_name', 'post_parent', 'type', 'post_type', 'post_id', 'post_ID') as $key ) { if ( !empty($query->query_vars[$key]) ) { return; // don't slow down queries that wouldn't include action_log comments anyway } } $query->query_vars['action_log_filter'] = TRUE; add_filter( 'comments_clauses', array( $this, 'filter_comment_query_clauses' ), 10, 2 ); }