AnsPress_Comment_Hooks::the_comments( array $comments )

Description #

Filter comments array to include only comments which user can read.

Parameters #

  • $comments
    array (Required) Comments.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: includes/comments.php

	public static function the_comments( $comments ) {
		foreach ( $comments as $k => $c ) {
			if ( 'anspress' === $c->comment_type && ! ap_user_can_read_comment( $c ) ) {
				unset( $comments[ $k ] );
			}
		}

		return $comments;
	}

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