Using current meta key with mycred?
-
I use a plugin that allows people to vote on posts, I can retrieve the number of points individual users have by doing something like this.
<?php function author_rating_total() { $user_id = get_the_author_meta( 'ID' ); $query = array ( 'author' => $user_id, 'suppress_filters' => 'true', 'posts_per_page' => -1 ); $queryObject = new WP_Query($query); while($queryObject->have_posts()) : $queryObject->the_post(); $post_ratings_data = get_post_custom(get_the_id()); $post_ratings_score = intval($post_ratings_data['redvote'][0]); $ratings_array[] = $post_ratings_score; endwhile; $ratings_sum = array_sum($ratings_array); if ($ratings_sum > 0) { $ratings_sum = '' . $ratings_sum; } echo $ratings_sum; wp_reset_query(); } ?> <?php echo author_rating_total(); ?>
Would it be possible to use that value as the number of points users get with mycred?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Using current meta key with mycred?’ is closed to new replies.