PluginProbe
bbPress / 2.6.17
bbPress v2.6.17
2.6.17 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 All 72 releases
← All changes | includes/admin/common.php +16 -25 trunk2.6.17 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,13 +12,11 @@
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 - *
20 - * @global array $menu WordPress admin menu entries.
21 19 */
22 20 function bbp_admin_separator() {
23 21
24 22 // Caps necessary where a separator is necessary
@@ -47,14 +45,14 @@
47 45 $menu[] = array( '', 'read', 'separator-bbpress', '', 'wp-menu-separator bbpress' );
48 46 }
49 47
50 48 /**
51 - * Tell WordPress we have a custom menu order.
49 + * Tell WordPress we have a custom menu order
52 50 *
53 51 * @since 2.0.0 bbPress (r2957)
54 52 *
55 - * @param bool $menu_order Menu order.
56 - * @return bool True when the bbPress separator is shown; otherwise the original value.
53 + * @param bool $menu_order Menu order
54 + * @return mixed True if separator, false if not
57 55 */
58 56 function bbp_admin_custom_menu_order( $menu_order = false ) {
59 57 if ( false === bbp_admin()->show_separator ) {
60 58 return $menu_order;
@@ -63,14 +61,14 @@
63 61 return true;
64 62 }
65 63
66 64 /**
67 - * Move our custom separator above our custom post types.
65 + * Move our custom separator above our custom post types
68 66 *
69 67 * @since 2.0.0 bbPress (r2957)
70 68 *
71 - * @param array $menu_order Menu Order.
72 - * @return array Modified menu order.
69 + * @param array $menu_order Menu Order
70 + * @return array Modified menu order
73 71 */
74 72 function bbp_admin_menu_order( $menu_order ) {
75 73
76 74 // Bail if user cannot see any top level bbPress menus
@@ -93,13 +91,13 @@
93 91 // Loop through menu order and do some rearranging
94 92 foreach ( $menu_order as $item ) {
95 93
96 94 // Position bbPress menus above appearance
97 - if ( $second_sep === $item ) {
95 + if ( $second_sep == $item ) {
98 96
99 97 // Add our custom menus
100 98 foreach ( $custom_menus as $custom_menu ) {
101 - if ( array_search( $custom_menu, $menu_order, true ) ) {
99 + if ( array_search( $custom_menu, $menu_order ) ) {
102 100 $bbp_menu_order[] = $custom_menu;
103 101 }
104 102 }
105 103
@@ -120,10 +118,10 @@
120 118 * Sanitize permalink slugs when saving the settings page.
121 119 *
122 120 * @since 2.6.0 bbPress (r5364)
123 121 *
124 - * @param string $slug Optional. Permalink slug to sanitize. Default empty.
125 - * @return string Sanitized slug without leading or trailing slashes.
122 + * @param string $slug
123 + * @return string
126 124 */
127 125 function bbp_sanitize_slug( $slug = '' ) {
128 126
129 127 // Don't allow multiple slashes in a row
@@ -141,16 +139,9 @@
141 139 // accidental poisoning of options values where we can.
142 140 $value = ltrim( $value, '/' );
143 141 $value = rtrim( $value, '/' );
144 142
145 - /**
146 - * Filters the sanitized slug value.
147 - *
148 - * @since 2.6.0 bbPress (r5364)
149 - *
150 - * @param string $value The sanitized slug.
151 - * @param string $slug The original slug value.
152 - */
143 + // Filter & return
153 144 return apply_filters( 'bbp_sanitize_slug', $value, $slug );
154 145 }
155 146
156 147 /**
@@ -157,9 +148,9 @@
157 148 * Uninstall all bbPress options and capabilities from a specific site.
158 149 *
159 150 * @since 2.1.0 bbPress (r3765)
160 151 *
161 - * @param int $site_id Optional. Site ID to uninstall. Defaults to the current site.
152 + * @param int $site_id
162 153 */
163 154 function bbp_do_uninstall( $site_id = 0 ) {
164 155 if ( empty( $site_id ) ) {
165 156 $site_id = get_current_blog_id();
@@ -181,10 +172,10 @@
181 172 * any third-party plugins.
182 173 *
183 174 * @since 2.1.0 bbPress (r3888)
184 175 *
185 - * @global string $plugin_page Current plugin admin page.
186 - * @global string $submenu_file Submenu item to highlight.
176 + * @global string $plugin_page
177 + * @global array $submenu_file
187 178 */
188 179 function bbp_tools_modify_menu_highlight() {
189 180 global $plugin_page, $submenu_file;
190 181