mycred_get_content_price

Description

This function returns the set price for a post that has been set for sale using the Sell Content add-on.

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

Available since version 1.7

Returns

(int | float) Returns the price set for the given point type.

Parameters

Param Type Required Description
function mycred_get_content_price(
$post_id int Yes

The post object ID.

$point_type string No

Option to get a price of a specific point type. Should only be used if posts are set for sale using a custom point type.

) { ... }

Examples

Example 1: Get the current posts price

global $post;

if ( mycred_post_is_for_sale( $post ) )
	printf( 'This post costs %s points', mycred_get_content_price( $post->ID ) );