bbPress Voting

bbPress Voting

توسط

This simple yet powerful plugin integrates with the bbPress forum plugin to add a new feature which allows users or visitors to vote up or down on topics and replies. Each topic and reply has a total score with an up arrow and a down arrow.

This plugin uses AJAX to save the vote on-the-fly without refreshing the page.

It’s also AMP compatible!

Visitors can only vote once on each topic or reply.

Features Included:
* Show or hide (and customize) labels for up and down
* Disable voting on topics or replies globally
* Disable voting on specific forums
* View-only score on closed topics
* Sort topics and replies by voting scores
* Admin bypass
* GamiPress integration

Pro Features Available:
* Historical weighted score visualization
* Accepted answers
* “Who voted” avatars
* Sort dropdown
* Sort on weighted score
* Sort on trending score
* Trending topics widget
* Schema for Q&A rich snippets
* Voting email notification to author
* Mark topics or replies with poor scores as spam

Purchase bbPress Voting Pro at WP For The Win!

  1. Just install and activate
  2. If you purchase the pro plugin, it must be installed alongside the free core plugin.

سوالات متداول

Are there other plugins like this?

No, and it’s the strangest thing. I was wanting a plugin to do this, and after much searching, I came to the conclusion that it didn’t exist, so I developed one myself… and my, how this has grown into quite a robust plugin!

How to you change the settings?

In the WordPress admin area, go to Settings > bbPress Voting

How do you hook into the function that saves the vote to write custom code?

This hook fires after a new vote has been saved.

add_action( 'bbp_voting_voted', 'my_function_on_bbp_vote', 10, 4 );
function my_function_on_bbp_vote( $post_id, $direction, $score, $identifier ) {
    // Do something
    // $post_id will be the ID of the topic or reply that was voted on
    // $direction will be 1 for upvote, -1 for downvote, or 0 for removed vote
    // $score will be the new total score
    // $identifier will be either a numeric user ID or an IP address of a non-logged-in visitor
}

How do you allow voting only on certain forums?

Edit the forum, and you will see a metabox on the sidebar that will let you enable or disable voting and/or sorting just on that forum.

You can also write custom code to do it. This function in your child theme’s functions.php file will let you choose which forum IDs are allowed to have voting…

add_filter( 'bbp_voting_allowed_on_forum', 'allowed_voting_forums', 10, 2 );
function allowed_voting_forums( $allowed, $forum_id ) {
    if( in_array( $forum_id, array(123, 124, 125) ) ) {
        $allowed = true;
    } else {
        $allowed = false;
    }
    return $allowed;
}

Can you allow administrators to vote repeatedly without limitations?

By default nobody can vote repeatedly on the same topic or reply, but you can enable this only for administrators by enabling the “Admin Bypass” settings.

How do you make this work with the BuddyBoss Platform and BuddyBoss Theme?

In the bbPress Voting settings, enabled BuddyBoss Theme Compatibility.

Then, in order to get the voting buttons to show up on a forums’ topic list page, you need to apply one theme override to the BuddyBoss theme since they removed all the standard bbPress hooks in the place where that would go.

Copy the file from /wp-content/themes/buddyboss/bbpress/loop-topic-list.php and paste it in /wp-content/themes/buddyboss-child/bbpress/loop-topic-list.php

Edit the pasted file in the child theme and add <?php do_action( 'bbp_theme_before_topic_title' ); ?> in between <div class="flex flex-1"> and <div class="item-avatar bb-item-avatar-wrap">.

        <div class="flex flex-1">

            <!-- Start theme override for bbPress Voting -->
            <?php do_action( 'bbp_theme_before_topic_title' ); ?>
            <!-- End theme override for bbPress Voting -->

            <div class="item-avatar bb-item-avatar-wrap">

×
نظری برای این آیتم موجود نیست.
0 0 رای ها
امتیازدهی
اشتراک در
اطلاع از
0 نظرات
قدیمی‌ترین
تازه‌ترین بیشترین رأی
نسخه حجم فایل SHA256 تغییرات دانلود
2.1.13.6 26 کیلوبایت -
دانلود
×
★★★★★
★★★★★
4.7 /5 (10 نظر)

قیمت:

رایگان

نگارش

2.1.13.6

آخرین انتشار

16 اردیبهشت 1405

آخرین بروزرسانی

3 ماه پیش

نصب های فعال

500+

نگارش وردپرس

وردپرس 4.0.0+

تست شده از نسخه

وردپرس 6.9.4

نگارش PHP

PHP 5.6+

نسخه ها

1 نسخه