PluginProbe
bbPress / 2.6.6
bbPress v2.6.6
trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.2.2 All 71 releases
← All changes | includes/admin/common.php +12 -22 trunk2.6.6 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2
3 3 /**
4 - * bbPress Admin Functions.
4 + * bbPress Admin Functions
5 5 *
6 6 * @package bbPress
7 7 * @subpackage Administration
8 8 */
@@ -12,9 +12,9 @@
12 12
13 13 /** Admin Menus ***************************************************************/
14 14
15 15 /**
16 - * Add a separator to the WordPress admin menus.
16 + * Add a separator to the WordPress admin menus
17 17 *
18 18 * @since 2.0.0 bbPress (r2957)
19 19 */
20 20 function bbp_admin_separator() {
@@ -40,19 +40,18 @@
40 40 }
41 41
42 42 global $menu;
43 43
44 - // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
45 44 $menu[] = array( '', 'read', 'separator-bbpress', '', 'wp-menu-separator bbpress' );
46 45 }
47 46
48 47 /**
49 - * Tell WordPress we have a custom menu order.
48 + * Tell WordPress we have a custom menu order
50 49 *
51 50 * @since 2.0.0 bbPress (r2957)
52 51 *
53 - * @param bool $menu_order Menu order.
54 - * @return mixed True if separator, false if not.
52 + * @param bool $menu_order Menu order
53 + * @return mixed True if separator, false if not
55 54 */
56 55 function bbp_admin_custom_menu_order( $menu_order = false ) {
57 56 if ( false === bbp_admin()->show_separator ) {
58 57 return $menu_order;
@@ -61,14 +60,14 @@
61 60 return true;
62 61 }
63 62
64 63 /**
65 - * Move our custom separator above our custom post types.
64 + * Move our custom separator above our custom post types
66 65 *
67 66 * @since 2.0.0 bbPress (r2957)
68 67 *
69 - * @param array $menu_order Menu Order.
70 - * @return array Modified menu order.
68 + * @param array $menu_order Menu Order
69 + * @return array Modified menu order
71 70 */
72 71 function bbp_admin_menu_order( $menu_order ) {
73 72
74 73 // Bail if user cannot see any top level bbPress menus
@@ -91,13 +90,13 @@
91 90 // Loop through menu order and do some rearranging
92 91 foreach ( $menu_order as $item ) {
93 92
94 93 // Position bbPress menus above appearance
95 - if ( $second_sep === $item ) {
94 + if ( $second_sep == $item ) {
96 95
97 96 // Add our custom menus
98 97 foreach ( $custom_menus as $custom_menu ) {
99 - if ( array_search( $custom_menu, $menu_order, true ) ) {
98 + if ( array_search( $custom_menu, $menu_order ) ) {
100 99 $bbp_menu_order[] = $custom_menu;
101 100 }
102 101 }
103 102
@@ -139,16 +138,9 @@
139 138 // accidental poisoning of options values where we can.
140 139 $value = ltrim( $value, '/' );
141 140 $value = rtrim( $value, '/' );
142 141
143 - /**
144 - * Filters the sanitized slug value.
145 - *
146 - * @since 2.6.0 bbPress (r5364)
147 - *
148 - * @param string $value The sanitized slug.
149 - * @param string $slug The original slug value.
150 - */
142 + // Filter & return
151 143 return apply_filters( 'bbp_sanitize_slug', $value, $slug );
152 144 }
153 145
154 146 /**
@@ -155,9 +147,9 @@
155 147 * Uninstall all bbPress options and capabilities from a specific site.
156 148 *
157 149 * @since 2.1.0 bbPress (r3765)
158 150 *
159 - * @param int $site_id Site id.
151 + * @param int $site_id
160 152 */
161 153 function bbp_do_uninstall( $site_id = 0 ) {
162 154 if ( empty( $site_id ) ) {
163 155 $site_id = get_current_blog_id();
@@ -187,9 +179,7 @@
187 179 global $plugin_page, $submenu_file;
188 180
189 181 // This tweaks the Tools subnav menu to only show one bbPress menu item
190 182 if ( ! in_array( $plugin_page, array( 'bbp-settings' ), true ) ) {
191 -
192 - // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
193 183 $submenu_file = 'bbp-repair';
194 184 }
195 185 }