Support » Plugin: myCRED » charge upfront before publishing post or page

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Gabriel

    (@designbymerovingi)

    Hi.

    You can always “Award” a negative value for published content. If you do, each time a user publishes a post, he will loose points instead of gaining.

    Yes, I know about this great feature. But it’s for “published” content.
    What about before publishing ?

    Plugin Author Gabriel

    (@designbymerovingi)

    So you want to give points for draft posts or pending posts?

    yes for charging / deducting

    Plugin Author Gabriel

    (@designbymerovingi)

    You could adjust the “Points for publishing content” hook to instead of awarding / deducting points for published content to deduct points for i.e. pending posts (posts submitted by contributors but not yet published) via the mycred_publish_hook_new hook.

    Example: Change the hook to award / deduct points for pending posts:

    add_filter( 'mycred_publish_hook_new', 'points_for_pending_posts' );
    function points_for_pending_posts( $statuses ) {
    	return array( 'pending' );
    }

    Hey, Great thanks !
    Some users are allowed to publish content directly (no pending and without admin approbation) will the new “hook” work and charge points to these users ?

    Plugin Author Gabriel

    (@designbymerovingi)

    The above code will change the Points for publishing content hook so point will only be awarded / deducted for pending points. If you want both, you will need to create a custom hook that specialize in only deducting points from pending posts and not published.

    ok got it – thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘charge upfront before publishing post or page’ is closed to new replies.