WordPress.org

Ready to get started?Download WordPress

Forums

myCRED
[resolved] charge upfront before publishing post or page (9 posts)

  1. fcpro
    Member
    Posted 6 months ago #

    Hi,
    Is there a way for chargong cred upfront to users, meanning before users can publish a post or page ?

    Thank you

    https://wordpress.org/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 6 months ago #

    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.

  3. fcpro
    Member
    Posted 6 months ago #

    Yes, I know about this great feature. But it's for "published" content.
    What about before publishing ?

  4. Gabriel
    Member
    Plugin Author

    Posted 6 months ago #

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

  5. fcpro
    Member
    Posted 6 months ago #

    yes for charging / deducting

  6. Gabriel
    Member
    Plugin Author

    Posted 6 months ago #

    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' );
    }
  7. fcpro
    Member
    Posted 6 months ago #

    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 ?

  8. Gabriel
    Member
    Plugin Author

    Posted 6 months ago #

    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.

  9. fcpro
    Member
    Posted 6 months ago #

    ok got it - thank you

Reply

You must log in to post.

About this Plugin

About this Topic