Allow users to vote up or down to topics and replies inside bbPress, just like you can on StackOverflow for example.
|Author:||G.Breant (profile at wordpress.org)|
|WordPress version required:||4.1.1|
|WordPress version tested:||4.6.1|
|Added to WordPress repository:||03-04-2015|
|Total downloads:||6 746|
Click to start download
A single reply with score, vote up and vote down links (top) and vote log (after reply content)
Plugin's options page
I can’t see the vote links
Users cannot vote for themselves. If you are the author of a topic or reply, the vote links won’t be available; the score only will be shown.
Can I filter the query to sort posts by votes ?
Yes, you can sort the posts by score or votes count, using the query variable ‘bbpvote_sort’.
Allowed values are ‘score_desc’, ‘score_asc’, ‘count_desc’, ‘count_asc’.
Example of a query that will fetch the 5 last topics, ordered by score (desc) :
<?php $best_rated_topics_args = array( 'post_type' => bbp_topic_post_type(), //or 'topic' 'posts_per_page' => 5, 'bbpvote_sort' => 'score_desc' //plugin ); $best_rated_topics = new WP_Query( $best_rated_topics_args ); ?>
See function sort_by_votes() for more details.
How can I customize the look of the vote links ?
The best way to customize the links is to setup some CSS rules in your theme.
Check this example on CodePen to see how to have images displayed instead of text.
If you need more complex customization, you can filter the links using those hooks :
- karma transient fix
- new BuddyPress profile submenu : forum>karma, where replies are sorted by score
- Fixed sort topics by votes
- Fixed bug when displaying topic score
- Fixed typo in settings
- Rebuild scores option
- Migrate options page
- Option to choose the ‘score’ unit (pts, kudos, …)
- Option to choose which post types are enabled for voting (topics/replies)
- Use Dashicons instead of fontAwesome in some places
- Use a transient to cache author’s karma
- supports unvoting (by reclicking the link)
- “sort by votes” link before topics loop
- Added option to hide voters identity in the vote log
- Added option to disable downvoting
- Added options page (under Settings > Forums)
- Display the score of an topic next to its author when showing a topics list
- Display the “reputation” score of an author next to its name when displaying a reply
- SCSS files
- CSS bug fix (https://wordpress.org/support/topic/avatars-not-in-a-row)
- Removed the function ‘author_link_karma’ hooked on the filter ‘bbp_get_reply_author_link’ as it shows up everywhere.
It’s easier to edit the bbPress templates and to call bbpvotes_get_author_score().
- New template functions to get votes count by user : bbpvotes_get_votes_down_by_user_count(), bbpvotes_get_votes_up_by_user_count(), bbpvotes_get_votes_total_by_user_count()
- New template functions to get an author’s score : bbpvotes_get_author_score()
- Embeds author’s karma (score) under its name, when showing a reply
- Russian translation by VovaZ
- Added two meta keys : ‘bbpvotes_vote_score’ (total score) and ‘bbpvotes_vote_count’ (total votes).
- Filter query to sort items by score or votes count.
- Fixed crash when BuddyPress is not installed
- Append votes log with ajax when user has voted
- French translation
- Added pot files for translations
- Replaced ajaxurl with bbpvotesL10n.ajaxurl in bbpvotes.js
- Fixed $user_vote_link link in bbpvotes_get_post_votes_log()
- Fixed ‘bbpvotes-post-no-score’ class in bbpvotes_get_score_link()
- Minor fixes
- First release