mycred_get_content_buyers_count

Description

This function returns the total number of unique users that have purchased a given post.

This function is only available if the Sell Content add-on is enabled.

Available since version 1.7

Returns

(int) The total number of users that has bought this post.

Parameters

Param Type Required Description
function mycred_get_content_buyers_count(
$post_id int Yes

The post object ID.

) { ... }

Examples

Example 1: Get the current posts total buyers count.

global $post;

printf( 'A total of %d users have bought access to this post!', mycred_get_content_buyers_count( $post->ID ) );