mycred_post_is_for_sale

Description

This function checks if a specific post is set for sale in the Sell Content add-on. This can be due to all posts of this type is set for sale or in manual mode, if the post has been selected to be for sale.

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

Available since version 1.7

Returns

(bool) TRUE if the post is for sale else FALSE.

Parameters

Param Type Required Description
function mycred_post_is_for_sale(
$post_id int or obj Yes

Either a post object ID or a post object.

) { ... }

Examples

Example 1: Check if the current post, based on the $post global, is set for sale.

global $post;

if ( mycred_post_is_for_sale( $post ) ) {

	// Post is set for sale

}