mycred_sell_expire_calc

Description

By default, myCRED allows you to let purchases expire after a certain number of hours. This filter lets you change this calculation from hours to any other time measurement. If you use this filter you should also consult the mycred_sell_exp_title filter.

Remember! The returned number is added to the purchase time and compared to see if it is still in the future (purchase valid) or if that time has passed (purchase expired). For this reason the value you return must be in seconds.

Available since version 1.4

Parameters

Param
Type
Required
Description
$expiration

INT

No

The expiration length in seconds. This value is multiplied with the length you set e.g. 2 hours, and added to the time a user last paid.

$length

INT

No

The length set for this particular post.

$user_id

INT

No

The numeric ID of the user this calculation is related to.

$post_id

INT

No

The post ID.

Used By

Package
Prio
Description

10

Used by the mycred_content_purchase_has_expired function.

Examples

Example 1: Change the expiration length calculation from using hours to days.