comment_feed_where
Filters the WHERE clause of the comments feed query before sending.
Usage
add_filter( 'comment_feed_where', 'wp_kama_comment_feed_where_filter' );
/**
* Function for `comment_feed_where` filter-hook.
*
* @param string $cwhere The WHERE clause of the query.
*
* @return string
*/
function wp_kama_comment_feed_where_filter( $cwhere ){
// filter...
return $cwhere;
}
- $cwhere(string)
- The WHERE clause of the query.
Changelog
| Since 2.2.0 | Introduced. |
Where the hook is called
comment_feed_where
wp-includes/class-wp-query.php 2861
$cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );
wp-includes/class-wp-query.php 3557
$cwhere = apply_filters_ref_array( 'comment_feed_where', array( $wpdb->prepare( "WHERE comment_post_ID = '%d' AND comment_approved = '1' AND {$wpdb->comments}.comment_type != 'note'", $this->posts[0]->ID ), &$this ) ); // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.QuotedSimplePlaceholder -- Quoted to keep the SQL unchanged for filters.