# bbp-core/2.0.0/includes/admin/options/options_voting.php

Forumax – AI Powered Advanced Community Forum Plugin, version 2.0.0. 186 lines.

- Page: https://pluginprobe.com/plugins/bbp-core/2.0.0/code/includes/admin/options/options_voting.php
- Raw: https://pluginprobe.com/plugins/bbp-core/2.0.0/raw/includes/admin/options/options_voting.php
- Modified: 2026-01-01T11:09:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bbp-core/2.0.0/code/includes/admin/options/options_voting.php#L10-L20`.

```php
<?php
// Create a section.
CSF::createSection(
    $prefix,
    [
        'title'  => __( 'Voting', 'forumax' ),
		'icon'   => 'dashicons dashicons-thumbs-up',
        'fields' => [
            [
                'id'      => 'is_votes',
                'type'    => 'switcher',
                'default' => 1,
                'title'   => __( 'Enable BBP Voting Features?', 'forumax' ),
            ],

            [
                'type'    => 'subheading',
                'content' => __( 'Voting Labels', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true' ]	
            ],

            [
                'id'       => 'is_label',
                'type'     => 'switcher',
                'default'  => false,
                'title'    => __( 'Show Labels', 'forumax' ),
                'subtitle' => __( 'Show the labels that describe what up and down mean?', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true' ]
            ],

            [
                'id'       => 'upvote_label',
                'type'     => 'text',
                'title'    => __( 'Upvote Label.', 'forumax' ),
                'default'  => __( 'Upvote', 'forumax' ),
                'subtitle' => __( 'Change the upvote label from "Upvote" to something else.', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true' ]
            ],

            [
                'id'       => 'downvote_label',
                'type'     => 'text',
                'title'    => __( 'Downvote Label.', 'forumax' ),
                'default'  => __( 'Downvote', 'forumax' ),
                'subtitle' => __( 'Change the downvote label from "Downvote" to something else.', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true' ]
            ],

            [
                'id'          => 'vote_numbers_display',
                'type'        => 'select',
                'title'       => __( 'Display Vote Numbers', 'forumax' ),
                'sub'         => __( 'Choose how to display the number of up votes and down votes', 'forumax' ),
                'chosen'      => true,
                'placeholder' => __( 'Select an option', 'forumax' ),
                'options'     => [
                    'hover'       => __( 'Hover', 'forumax' ),
                    'always-show' => __( 'Always Show', 'forumax' ),
                    'hide'        => __( 'Hide', 'forumax' ),
                ],
                'default'     => 'hover',
				'dependency' => [ 'is_votes', '==', 'true' ]
            ],

            [
                'type'    => 'subheading',
                'content' => __( 'Voting Buttons', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_voting_disabled_topics',
                'type'     => 'switcher',
                'default'  => 0,
                'title'    => __( 'Voting on Topics', 'forumax' ),
                'subtitle' => __( 'You can override this at the forum level', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_voting_disabled_replies',
                'type'     => 'switcher',
                'default'  => 0,
                'title'    => __( 'Voting on Replies', 'forumax' ),
                'subtitle' => __( 'You can override this at the forum level', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_down_votes_disabled',
                'type'     => 'switcher',
                'default'  => 0,
                'title'    => __( 'Down Votes', 'forumax' ),
                'subtitle' => __( 'Only Allow Up Votes', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'type'    => 'subheading',
                'content' => __( 'View-Only Scores', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_disabled_voting_for_non_logged_users',
                'type'     => 'switcher',
                'default'  => 0,
                'title'    => __( 'Disable voting for visitors who are not logged in', 'forumax' ),
                'subtitle' => __( 'Scores will display (if configured to), but voting will be disabled if not logged in', 'forumax' ),
                'class'    => 'st-pro-notice',
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_disabled_voting_closed_topics',
                'type'     => 'switcher',
                'default'  => 0,
                'title'    => __( 'Disable adding new votes after a topic is closed', 'forumax' ),
                'subtitle' => __( 'Scores will display (if configured to), but new votes for the topic or the topic\'s replies will be disabled', 'forumax' ),
                'class'   => 'st-pro-notice',
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_disabled_voting_own_topic_reply',
                'type'     => 'switcher',
                'default'  => 0,
                'title'    => __( 'Don\'t allow authors to vote on their own topic/reply', 'forumax' ),
                'subtitle' => __( 'They can still vote on other people\'s topics/replies', 'forumax' ),
                'class'   => 'st-pro-notice',
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'type'    => 'subheading',
                'content' => __( 'Admin Voting', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'      => 'is_admin_can_vote_unlimited',
                'type'    => 'switcher',
                'default' => 0,
                'title'   => __( 'Allow any administrator user to vote as much as they want?', 'forumax' ),
                'class'   => 'st-pro-notice',
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],
            
            [
                'type'    => 'subheading',
                'content' => __( 'Sort by Voting Scores', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_sort_topic_by_votes',
                'type'     => 'switcher',
                'default'  => 1,
                'title'    => __( 'Sort topics in a forum using their voting scores?', 'forumax' ),
                'subtitle' => __( 'Highest voted topics on top', 'forumax' ),
                'class'    => 'st-pro-notice',
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_sort_reply_by_votes',
                'type'     => 'switcher',
                'default'  => 1,
                'title'    => __( 'Sort replies on a topic using their voting scores?', 'forumax' ),
                'subtitle' => __( 'Highest voted replies on top', 'forumax' ),
                'class'   => 'st-pro-notice',
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],

            [
                'id'       => 'is_lead_topic_broken',
                'type'     => 'switcher',
                'default'  => 1,
                'title'    => __( ' Break out the lead topic to separate it from the replies', 'forumax' ),
                'subtitle' => __( 'Simply enabled the built-in hook, bbp_show_lead_topic. This is useful to resolve a bug when sort order is messed up when Threaded Replies are enabled.', 'forumax' ),
				'dependency' => [ 'is_votes', '==', 'true', ]
            ],
        ],
    ]
);

```
