Rate my post support for gamipress plugin
-
Hello,
Please can you help correct this code to work with the gamipress plugin at https://www.ads-software.com/plugins/gamipress/
/* assign different ngx points by gamipress to users who receive 4 or 5 star rating in their post (rate my post plugin) */ function my_assign_ngx_points_on_rating($submitted_rating, $post_id) { // Get the post type of the post $post_type = get_post_type($post_id); // Check if the post type is "post" or "advert" if ($post_type == 'post' || $post_type == 'advert') { // Check if the rating is 5 stars if ($submitted_rating == 5) { // Get the user ID of the post author $user_id = get_post_field('post_author', $post_id); // Assign 5 ngx points to the user gamipress_update_user_points($user_id, 5, 'ngx', 'You earned 5 ngx points for receiving a 5 star rating'); } // Check if the rating is 4 stars if ($submitted_rating == 4) { // Get the user ID of the post author $user_id = get_post_field('post_author', $post_id); // Assign 4 ngx points to the user gamipress_update_user_points($user_id, 4, 'ngx', 'You earned 4 ngx points for receiving a 4 star rating'); } } } add_action('rmp_after_vote', 'my_assign_ngx_points_on_rating', 10, 2);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Rate my post support for gamipress plugin’ is closed to new replies.