AnsPress_Admin::filter_comments_query( array $clauses )

Description #

Filter comment clauses, join meta where key is _ap_flag As pre_get_comments custom meta query not working so we are adding JOIN statement

Parameters #

  • $clauses
    array (Required) WordPress comment clauses.

Source #

File: admin/anspress-admin.php

	public static function filter_comments_query( $clauses ) {
		global $wpdb;
		$clauses['join'] = "JOIN $wpdb->commentmeta ON $wpdb->comments.comment_ID = $wpdb->commentmeta.comment_id AND meta_key = '_ap_flag'";

		return $clauses;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment