mycred_post_type_for_sale
Description
This function checks if a given post type is set for sale in the Sell Content settings.
This function is only available if the Sell Content add-on is enabled.
Available since version 1.0
Returns
(bool) TRUE if the post type is set for sale else FALSE.
Parameters
| Param | Type | Required | Description | |
|---|---|---|---|---|
function mycred_post_type_for_sale( |
||||
$post_type |
string | Yes | The WordPress post type to check. |
|
) { ... } |
||||
Examples
Example 1: Check if the custom post type “Book“ is set for sale.
$post_type = 'book';
if ( mycred_post_type_for_sale( $post_type ) ) {
// Post type is set for sale
}