ap_count_post_flags( integer $post_id )

Description #

Count flag votes.

Parameters #

  • $post_id
    integer (Required) Post ID.

Source #

File: includes/flag.php

function ap_count_post_flags( $post_id ) {
	$rows = ap_count_votes(
		array(
			'vote_post_id' => $post_id,
			'vote_type'    => 'flag',
		)
	);

	if ( false !== $rows ) {
		return (int) $rows[0]->count;
	}

	return 0;
}

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