• Resolved dejman

    (@dejman)


    Points are not assigned for reviews using the myCred points for comments hook. I believe directorist reviews use the WordPress comment functionality. Do you have any thoughts/help on this?

Viewing 1 replies (of 1 total)
  • Plugin Support Al-Amin Khan

    (@alamin56649)

    Hi @dejman,

    Thanks for reaching out!

    You’re correct that Directorist reviews are based on the native WordPress comment system. If you’d like to award myCred points for submitted reviews, you can use a custom hook like the one below:

    // Award points for Directorist reviews
    add_action('comment_post', function($comment_id, $comment_approved, $comment_data) {
        if ($comment_data['comment_type'] === 'review' && $comment_approved === 1 && !empty($comment_data['user_id'])) {
            if (function_exists('mycred_add')) {
                mycred_add('directorist_review', $comment_data['user_id'], 10, 'Review posted', $comment_id);
            }
        }
    }, 20, 3);
    

    This code awards 10 points when a Directorist review is successfully posted and approved. Just make sure the comment_type is set to 'review' in your configuration.

    Hope this helps! Let me know if you need further assistance.

    Best regards,
    Al-Amin Khan
    Directorist Support Team

Viewing 1 replies (of 1 total)

The topic ‘myCred integration’ is closed to new replies.