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