PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.0
Forumax – AI Powered Advanced Community Forum Plugin v2.5.0
2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 All 30 releases
← All changes | includes/features/bbp_voting/metabox.php +42 -33 1.3.2 → 2.5.0 View file →
@@ -19,75 +19,84 @@
19 19 // Meta box form.
20 20 function bbp_voting_forum_metabox() {
21 21 $post_id = get_the_ID();
22 22 $options = [
23 - '' => 'Default',
24 - 'true' => 'Enable',
25 - 'false' => 'Disable',
23 + '' => __( 'Default', 'forumax' ),
24 + 'true' => __( 'Enable', 'forumax' ),
25 + 'false' => __( 'Disable', 'forumax' ),
26 26 ];
27 27 ?>
28 28 <p class="description">
29 - Enable or disable voting on topics or replies, only for this forum.
29 + <?php esc_html_e( 'Enable or disable voting on topics or replies, only for this forum.', 'forumax' ); ?>
30 30 </p>
31 +
31 32 <p>
32 - <strong class="label">Voting on Topics:</strong>
33 - <select type="checkbox" name="bbp_voting_forum_enable_topics" value="true" id="bbp_voting_forum_enable_topics" class="bbp_dropdown">
33 + <strong class="label"><?php esc_html_e( 'Voting on Topics:', 'forumax' ); ?></strong>
34 + <select name="bbp_voting_forum_enable_topics" id="bbp_voting_forum_enable_topics" class="bbp_dropdown">
34 35 <?php
35 36 $selected = get_post_meta( $post_id, 'bbp_voting_forum_enable_topics', true );
36 37 foreach ( $options as $value => $label ) {
37 - echo '<option value="' . $value . '" ';
38 - if ( $selected == $value ) {
39 - echo 'selected';
40 - }
41 - echo '>' . $label . '</option>';
38 + printf(
39 + '<option value="%s" %s>%s</option>',
40 + esc_attr( $value ),
41 + selected( $selected, $value, false ),
42 + esc_html( $label )
43 + );
42 44 }
43 45 ?>
44 46 </select>
45 47 </p>
48 +
46 49 <p>
47 - <strong class="label">Voting on Replies:</strong>
48 - <select type="checkbox" name="bbp_voting_forum_enable_replies" value="true" id="bbp_voting_forum_enable_replies" class="bbp_dropdown">
50 + <strong class="label"><?php esc_html_e( 'Voting on Replies:', 'forumax' ); ?></strong>
51 + <select name="bbp_voting_forum_enable_replies" id="bbp_voting_forum_enable_replies" class="bbp_dropdown">
49 52 <?php
50 53 $selected = get_post_meta( $post_id, 'bbp_voting_forum_enable_replies', true );
51 54 foreach ( $options as $value => $label ) {
52 - echo '<option value="' . $value . '" ';
53 - if ( $selected == $value ) {
54 - echo 'selected';
55 - }
56 - echo '>' . $label . '</option>';
55 + printf(
56 + '<option value="%s" %s>%s</option>',
57 + esc_attr( $value ),
58 + selected( $selected, $value, false ),
59 + esc_html( $label )
60 + );
57 61 }
58 62 ?>
59 63 </select>
60 64 </p>
65 +
61 66 <p class="description">
62 - Enable or disable sorting based on votes on topics or replies, only for this forum.
67 + <?php esc_html_e( 'Enable or disable sorting based on votes on topics or replies, only for this forum.', 'forumax' ); ?>
63 68 </p>
69 +
64 70 <p>
65 - <strong class="label">Sort Topics by Votes:</strong>
66 - <select type="checkbox" name="sort_bbpress_topics_by_votes_on_forum" value="true" id="sort_bbpress_topics_by_votes_on_forum" class="bbp_dropdown">
71 + <strong class="label"><?php esc_html_e( 'Sort Topics by Votes:', 'forumax' ); ?></strong>
72 + <select name="sort_bbpress_topics_by_votes_on_forum" id="sort_bbpress_topics_by_votes_on_forum" class="bbp_dropdown">
67 73 <?php
68 74 $selected = get_post_meta( $post_id, 'sort_bbpress_topics_by_votes_on_forum', true );
69 75 foreach ( $options as $value => $label ) {
70 - echo '<option value="' . $value . '" ';
71 - if ( $selected == $value ) {
72 - echo 'selected';
73 - }
74 - echo '>' . $label . '</option>';
76 + printf(
77 + '<option value="%s" %s>%s</option>',
78 + esc_attr( $value ),
79 + selected( $selected, $value, false ),
80 + esc_html( $label )
81 + );
75 82 }
76 83 ?>
77 84 </select>
78 85 </p>
86 +
79 87 <p>
80 - <strong class="label">Sort Replies by Votes:</strong>
81 - <select type="checkbox" name="sort_bbpress_replies_by_votes_on_forum" value="true" id="sort_bbpress_replies_by_votes_on_forum" class="bbp_dropdown">
88 + <strong class="label"><?php esc_html_e( 'Sort Replies by Votes:', 'forumax' ); ?></strong>
89 + <select name="sort_bbpress_replies_by_votes_on_forum" id="sort_bbpress_replies_by_votes_on_forum" class="bbp_dropdown">
82 90 <?php
83 91 $selected = get_post_meta( $post_id, 'sort_bbpress_replies_by_votes_on_forum', true );
84 92 foreach ( $options as $value => $label ) {
85 - echo '<option value="' . $value . '" ';
86 - if ( $selected == $value ) {
87 - echo 'selected';
88 - }
89 - echo '>' . $label . '</option>';
93 + printf(
94 + '<option value="%s" %s>%s</option>',
95 + esc_attr( $value ),
96 + selected( $selected, $value, false ),
97 + esc_html( $label )
98 + );
90 99 }
91 100 ?>
92 101 </select>
93 102 </p>