| @@ -1,185 +1,185 @@ | ||
| 1 | -<?php | |
| 2 | -// Create a section. | |
| 3 | -CSF::createSection( | |
| 4 | - $prefix, | |
| 5 | - [ | |
| 6 | - 'title' => __( 'Voting', 'bbp-core' ), | |
| 7 | - 'icon' => 'dashicons dashicons-thumbs-up', | |
| 8 | - 'fields' => [ | |
| 9 | - [ | |
| 10 | - 'id' => 'is_votes', | |
| 11 | - 'type' => 'switcher', | |
| 12 | - 'default' => 1, | |
| 13 | - 'title' => __( 'Enable BBP Voting Features?', 'bbp-core' ), | |
| 14 | - ], | |
| 15 | - | |
| 16 | - [ | |
| 17 | - 'type' => 'subheading', | |
| 18 | - 'content' => __( 'Voting Labels', 'bbp-core' ), | |
| 19 | - 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 20 | - ], | |
| 21 | - | |
| 22 | - [ | |
| 23 | - 'id' => 'is_label', | |
| 24 | - 'type' => 'switcher', | |
| 25 | - 'default' => false, | |
| 26 | - 'title' => __( 'Show Labels', 'bbp-core' ), | |
| 27 | - 'subtitle' => __( 'Show the labels that describe what up and down mean?', 'bbp-core' ), | |
| 28 | - 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 29 | - ], | |
| 30 | - | |
| 31 | - [ | |
| 32 | - 'id' => 'upvote_label', | |
| 33 | - 'type' => 'text', | |
| 34 | - 'title' => __( 'Upvote Label.', 'bbp-core' ), | |
| 35 | - 'default' => __( 'Upvote', 'bbp-core' ), | |
| 36 | - 'subtitle' => __( 'Change the upvote label from "Upvote" to something else.', 'bbp-core' ), | |
| 37 | - 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 38 | - ], | |
| 39 | - | |
| 40 | - [ | |
| 41 | - 'id' => 'downvote_label', | |
| 42 | - 'type' => 'text', | |
| 43 | - 'title' => __( 'Downvote Label.', 'bbp-core' ), | |
| 44 | - 'default' => __( 'Downvote', 'bbp-core' ), | |
| 45 | - 'subtitle' => __( 'Change the downvote label from "Downvote" to something else.', 'bbp-core' ), | |
| 46 | - 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 47 | - ], | |
| 48 | - | |
| 49 | - [ | |
| 50 | - 'id' => 'vote_numbers_display', | |
| 51 | - 'type' => 'select', | |
| 52 | - 'title' => __( 'Display Vote Numbers', 'bbp-core' ), | |
| 53 | - 'sub' => __( 'Choose how to display the number of up votes and down votes', 'bbp-core' ), | |
| 54 | - 'chosen' => true, | |
| 55 | - 'placeholder' => __( 'Select an option', 'bbp-core' ), | |
| 56 | - 'options' => [ | |
| 57 | - 'hover' => __( 'Hover', 'bbp-core' ), | |
| 58 | - 'always-show' => __( 'Always Show', 'bbp-core' ), | |
| 59 | - 'hide' => __( 'Hide', 'bbp-core' ), | |
| 60 | - ], | |
| 61 | - 'default' => 'hover', | |
| 62 | - 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 63 | - ], | |
| 64 | - | |
| 65 | - [ | |
| 66 | - 'type' => 'subheading', | |
| 67 | - 'content' => __( 'Voting Buttons', 'bbp-core' ), | |
| 68 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 69 | - ], | |
| 70 | - | |
| 71 | - [ | |
| 72 | - 'id' => 'is_voting_disabled_topics', | |
| 73 | - 'type' => 'switcher', | |
| 74 | - 'default' => 0, | |
| 75 | - 'title' => __( 'Voting on Topics', 'bbp-core' ), | |
| 76 | - 'subtitle' => __( 'You can override this at the forum level', 'bbp-core' ), | |
| 77 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 78 | - ], | |
| 79 | - | |
| 80 | - [ | |
| 81 | - 'id' => 'is_voting_disabled_replies', | |
| 82 | - 'type' => 'switcher', | |
| 83 | - 'default' => 0, | |
| 84 | - 'title' => __( 'Voting on Replies', 'bbp-core' ), | |
| 85 | - 'subtitle' => __( 'You can override this at the forum level', 'bbp-core' ), | |
| 86 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 87 | - ], | |
| 88 | - | |
| 89 | - [ | |
| 90 | - 'id' => 'is_down_votes_disabled', | |
| 91 | - 'type' => 'switcher', | |
| 92 | - 'default' => 0, | |
| 93 | - 'title' => __( 'Down Votes', 'bbp-core' ), | |
| 94 | - 'subtitle' => __( 'Only Allow Up Votes', 'bbp-core' ), | |
| 95 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 96 | - ], | |
| 97 | - | |
| 98 | - [ | |
| 99 | - 'type' => 'subheading', | |
| 100 | - 'content' => __( 'View-Only Scores', 'bbp-core' ), | |
| 101 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 102 | - ], | |
| 103 | - | |
| 104 | - [ | |
| 105 | - 'id' => 'is_disabled_voting_for_non_logged_users', | |
| 106 | - 'type' => 'switcher', | |
| 107 | - 'default' => 0, | |
| 108 | - 'title' => __( 'Disable voting for visitors who are not logged in', 'bbp-core' ), | |
| 109 | - 'subtitle' => __( 'Scores will display (if configured to), but voting will be disabled if not logged in', 'bbp-core' ), | |
| 110 | - 'class' => 'st-pro-notice', | |
| 111 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 112 | - ], | |
| 113 | - | |
| 114 | - [ | |
| 115 | - 'id' => 'is_disabled_voting_closed_topics', | |
| 116 | - 'type' => 'switcher', | |
| 117 | - 'default' => 0, | |
| 118 | - 'title' => __( 'Disable adding new votes after a topic is closed', 'bbp-core' ), | |
| 119 | - 'subtitle' => __( 'Scores will display (if configured to), but new votes for the topic or the topic\'s replies will be disabled', 'bbp-core' ), | |
| 120 | - 'class' => 'st-pro-notice', | |
| 121 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 122 | - ], | |
| 123 | - | |
| 124 | - [ | |
| 125 | - 'id' => 'is_disabled_voting_own_topic_reply', | |
| 126 | - 'type' => 'switcher', | |
| 127 | - 'default' => 0, | |
| 128 | - 'title' => __( 'Don\'t allow authors to vote on their own topic/reply', 'bbp-core' ), | |
| 129 | - 'subtitle' => __( 'They can still vote on other people\'s topics/replies', 'bbp-core' ), | |
| 130 | - 'class' => 'st-pro-notice', | |
| 131 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 132 | - ], | |
| 133 | - | |
| 134 | - [ | |
| 135 | - 'type' => 'subheading', | |
| 136 | - 'content' => __( 'Admin Voting', 'bbp-core' ), | |
| 137 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 138 | - ], | |
| 139 | - | |
| 140 | - [ | |
| 141 | - 'id' => 'is_admin_can_vote_unlimited', | |
| 142 | - 'type' => 'switcher', | |
| 143 | - 'default' => 0, | |
| 144 | - 'title' => __( 'Allow any administrator user to vote as much as they want?', 'bbp-core' ), | |
| 145 | - 'class' => 'st-pro-notice', | |
| 146 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 147 | - ], | |
| 148 | - | |
| 149 | - [ | |
| 150 | - 'type' => 'subheading', | |
| 151 | - 'content' => __( 'Sort by Voting Scores', 'bbp-core' ), | |
| 152 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 153 | - ], | |
| 154 | - | |
| 155 | - [ | |
| 156 | - 'id' => 'is_sort_topic_by_votes', | |
| 157 | - 'type' => 'switcher', | |
| 158 | - 'default' => 1, | |
| 159 | - 'title' => __( 'Sort topics in a forum using their voting scores?', 'bbp-core' ), | |
| 160 | - 'subtitle' => __( 'Highest voted topics on top', 'bbp-core' ), | |
| 161 | - 'class' => 'st-pro-notice', | |
| 162 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 163 | - ], | |
| 164 | - | |
| 165 | - [ | |
| 166 | - 'id' => 'is_sort_reply_by_votes', | |
| 167 | - 'type' => 'switcher', | |
| 168 | - 'default' => 1, | |
| 169 | - 'title' => __( 'Sort replies on a topic using their voting scores?', 'bbp-core' ), | |
| 170 | - 'subtitle' => __( 'Highest voted replies on top', 'bbp-core' ), | |
| 171 | - 'class' => 'st-pro-notice', | |
| 172 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 173 | - ], | |
| 174 | - | |
| 175 | - [ | |
| 176 | - 'id' => 'is_lead_topic_broken', | |
| 177 | - 'type' => 'switcher', | |
| 178 | - 'default' => 1, | |
| 179 | - 'title' => __( ' Break out the lead topic to separate it from the replies', 'bbp-core' ), | |
| 180 | - 'subtitle' => __( 'Simply enabled the built-in bbPress hook, bbp_show_lead_topic. This is useful to resolve a bug in bbPress when sort order is messed up when Threaded Replies are enabled in bbPress.', 'bbp-core' ), | |
| 181 | - 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 182 | - ], | |
| 183 | - ], | |
| 184 | - ] | |
| 185 | -); | |
| 1 | +<?php | |
| 2 | +// Create a section. | |
| 3 | +CSF::createSection( | |
| 4 | + $prefix, | |
| 5 | + [ | |
| 6 | + 'title' => __( 'Voting', 'forumax' ), | |
| 7 | + 'icon' => 'dashicons dashicons-thumbs-up', | |
| 8 | + 'fields' => [ | |
| 9 | + [ | |
| 10 | + 'id' => 'is_votes', | |
| 11 | + 'type' => 'switcher', | |
| 12 | + 'default' => 1, | |
| 13 | + 'title' => __( 'Enable BBP Voting Features?', 'forumax' ), | |
| 14 | + ], | |
| 15 | + | |
| 16 | + [ | |
| 17 | + 'type' => 'subheading', | |
| 18 | + 'content' => __( 'Voting Labels', 'forumax' ), | |
| 19 | + 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 20 | + ], | |
| 21 | + | |
| 22 | + [ | |
| 23 | + 'id' => 'is_label', | |
| 24 | + 'type' => 'switcher', | |
| 25 | + 'default' => false, | |
| 26 | + 'title' => __( 'Show Labels', 'forumax' ), | |
| 27 | + 'subtitle' => __( 'Show the labels that describe what up and down mean?', 'forumax' ), | |
| 28 | + 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 29 | + ], | |
| 30 | + | |
| 31 | + [ | |
| 32 | + 'id' => 'upvote_label', | |
| 33 | + 'type' => 'text', | |
| 34 | + 'title' => __( 'Upvote Label.', 'forumax' ), | |
| 35 | + 'default' => __( 'Upvote', 'forumax' ), | |
| 36 | + 'subtitle' => __( 'Change the upvote label from "Upvote" to something else.', 'forumax' ), | |
| 37 | + 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 38 | + ], | |
| 39 | + | |
| 40 | + [ | |
| 41 | + 'id' => 'downvote_label', | |
| 42 | + 'type' => 'text', | |
| 43 | + 'title' => __( 'Downvote Label.', 'forumax' ), | |
| 44 | + 'default' => __( 'Downvote', 'forumax' ), | |
| 45 | + 'subtitle' => __( 'Change the downvote label from "Downvote" to something else.', 'forumax' ), | |
| 46 | + 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 47 | + ], | |
| 48 | + | |
| 49 | + [ | |
| 50 | + 'id' => 'vote_numbers_display', | |
| 51 | + 'type' => 'select', | |
| 52 | + 'title' => __( 'Display Vote Numbers', 'forumax' ), | |
| 53 | + 'sub' => __( 'Choose how to display the number of up votes and down votes', 'forumax' ), | |
| 54 | + 'chosen' => true, | |
| 55 | + 'placeholder' => __( 'Select an option', 'forumax' ), | |
| 56 | + 'options' => [ | |
| 57 | + 'hover' => __( 'Hover', 'forumax' ), | |
| 58 | + 'always-show' => __( 'Always Show', 'forumax' ), | |
| 59 | + 'hide' => __( 'Hide', 'forumax' ), | |
| 60 | + ], | |
| 61 | + 'default' => 'hover', | |
| 62 | + 'dependency' => [ 'is_votes', '==', 'true' ] | |
| 63 | + ], | |
| 64 | + | |
| 65 | + [ | |
| 66 | + 'type' => 'subheading', | |
| 67 | + 'content' => __( 'Voting Buttons', 'forumax' ), | |
| 68 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 69 | + ], | |
| 70 | + | |
| 71 | + [ | |
| 72 | + 'id' => 'is_voting_disabled_topics', | |
| 73 | + 'type' => 'switcher', | |
| 74 | + 'default' => 0, | |
| 75 | + 'title' => __( 'Voting on Topics', 'forumax' ), | |
| 76 | + 'subtitle' => __( 'You can override this at the forum level', 'forumax' ), | |
| 77 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 78 | + ], | |
| 79 | + | |
| 80 | + [ | |
| 81 | + 'id' => 'is_voting_disabled_replies', | |
| 82 | + 'type' => 'switcher', | |
| 83 | + 'default' => 0, | |
| 84 | + 'title' => __( 'Voting on Replies', 'forumax' ), | |
| 85 | + 'subtitle' => __( 'You can override this at the forum level', 'forumax' ), | |
| 86 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 87 | + ], | |
| 88 | + | |
| 89 | + [ | |
| 90 | + 'id' => 'is_down_votes_disabled', | |
| 91 | + 'type' => 'switcher', | |
| 92 | + 'default' => 0, | |
| 93 | + 'title' => __( 'Down Votes', 'forumax' ), | |
| 94 | + 'subtitle' => __( 'Only Allow Up Votes', 'forumax' ), | |
| 95 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 96 | + ], | |
| 97 | + | |
| 98 | + [ | |
| 99 | + 'type' => 'subheading', | |
| 100 | + 'content' => __( 'View-Only Scores', 'forumax' ), | |
| 101 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 102 | + ], | |
| 103 | + | |
| 104 | + [ | |
| 105 | + 'id' => 'is_disabled_voting_for_non_logged_users', | |
| 106 | + 'type' => 'switcher', | |
| 107 | + 'default' => 0, | |
| 108 | + 'title' => __( 'Disable voting for visitors who are not logged in', 'forumax' ), | |
| 109 | + 'subtitle' => __( 'Scores will display (if configured to), but voting will be disabled if not logged in', 'forumax' ), | |
| 110 | + 'class' => 'st-pro-notice', | |
| 111 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 112 | + ], | |
| 113 | + | |
| 114 | + [ | |
| 115 | + 'id' => 'is_disabled_voting_closed_topics', | |
| 116 | + 'type' => 'switcher', | |
| 117 | + 'default' => 0, | |
| 118 | + 'title' => __( 'Disable adding new votes after a topic is closed', 'forumax' ), | |
| 119 | + 'subtitle' => __( 'Scores will display (if configured to), but new votes for the topic or the topic\'s replies will be disabled', 'forumax' ), | |
| 120 | + 'class' => 'st-pro-notice', | |
| 121 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 122 | + ], | |
| 123 | + | |
| 124 | + [ | |
| 125 | + 'id' => 'is_disabled_voting_own_topic_reply', | |
| 126 | + 'type' => 'switcher', | |
| 127 | + 'default' => 0, | |
| 128 | + 'title' => __( 'Don\'t allow authors to vote on their own topic/reply', 'forumax' ), | |
| 129 | + 'subtitle' => __( 'They can still vote on other people\'s topics/replies', 'forumax' ), | |
| 130 | + 'class' => 'st-pro-notice', | |
| 131 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 132 | + ], | |
| 133 | + | |
| 134 | + [ | |
| 135 | + 'type' => 'subheading', | |
| 136 | + 'content' => __( 'Admin Voting', 'forumax' ), | |
| 137 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 138 | + ], | |
| 139 | + | |
| 140 | + [ | |
| 141 | + 'id' => 'is_admin_can_vote_unlimited', | |
| 142 | + 'type' => 'switcher', | |
| 143 | + 'default' => 0, | |
| 144 | + 'title' => __( 'Allow any administrator user to vote as much as they want?', 'forumax' ), | |
| 145 | + 'class' => 'st-pro-notice', | |
| 146 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 147 | + ], | |
| 148 | + | |
| 149 | + [ | |
| 150 | + 'type' => 'subheading', | |
| 151 | + 'content' => __( 'Sort by Voting Scores', 'forumax' ), | |
| 152 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 153 | + ], | |
| 154 | + | |
| 155 | + [ | |
| 156 | + 'id' => 'is_sort_topic_by_votes', | |
| 157 | + 'type' => 'switcher', | |
| 158 | + 'default' => false, | |
| 159 | + 'title' => __( 'Sort topics in a forum using their voting scores?', 'forumax' ), | |
| 160 | + 'subtitle' => __( 'Highest voted topics on top', 'forumax' ), | |
| 161 | + 'class' => 'st-pro-notice', | |
| 162 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 163 | + ], | |
| 164 | + | |
| 165 | + [ | |
| 166 | + 'id' => 'is_sort_reply_by_votes', | |
| 167 | + 'type' => 'switcher', | |
| 168 | + 'default' => false, | |
| 169 | + 'title' => __( 'Sort replies on a topic using their voting scores?', 'forumax' ), | |
| 170 | + 'subtitle' => __( 'Highest voted replies on top', 'forumax' ), | |
| 171 | + 'class' => 'st-pro-notice', | |
| 172 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 173 | + ], | |
| 174 | + | |
| 175 | + [ | |
| 176 | + 'id' => 'is_lead_topic_broken', | |
| 177 | + 'type' => 'switcher', | |
| 178 | + 'default' => 1, | |
| 179 | + 'title' => __( ' Break out the lead topic to separate it from the replies', 'forumax' ), | |
| 180 | + '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' ), | |
| 181 | + 'dependency' => [ 'is_votes', '==', 'true', ] | |
| 182 | + ], | |
| 183 | + ], | |
| 184 | + ] | |
| 185 | +); | |