mycred_publish_hook_new

Description

The “Points for Publishing Content” hook reward users with points for publishing content. This act is rewarded when a posts status transitions from an “old status” to a “new status”.

 

The old status would include: drafts, pending for approval and scheduled post statuses. The new statuses include: published and privately published post statuses.

 

Any custom post statuses needs to be added in here if the status indicates content that is “published”. If your custom post status is a different type of “not published content” indicator, e.g. “Pending Approval”, the status need to be added using the mycred_publish_hook_old filter instead!

Available since version 1.6

Parameters

Param Type Required Description
$new_statuses array Yes

An array of statuses a post needs to transition to. By default these are: publish and private.

$post_id int No

The post objects ID.

$point_type string No

The point type key currently being processed.

Used By

Package Prio. Description
Not used by any built-in package.

Examples

Example 1: Add a custom “Archived“ post status to the “Points for publishing content“ hook in myCRED.