| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress Users Admin Class. | |
| 4 | + * bbPress Users Admin Class | |
| 5 | 5 | * |
| 6 | 6 | * @package bbPress |
| 7 | 7 | * @subpackage Administration |
| 8 | 8 | */ |
| @@ -11,9 +11,9 @@ | ||
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | if ( ! class_exists( 'BBP_Users_Admin' ) ) : |
| 14 | 14 | /** |
| 15 | - * Loads bbPress users admin area. | |
| 15 | + * Loads bbPress users admin area | |
| 16 | 16 | * |
| 17 | 17 | * @package bbPress |
| 18 | 18 | * @subpackage Administration |
| 19 | 19 | * @since 2.0.0 bbPress (r2464) |
| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | class BBP_Users_Admin { |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * The bbPress users admin loader. | |
| 24 | + * The bbPress users admin loader | |
| 25 | 25 | * |
| 26 | 26 | * @since 2.0.0 bbPress (r2515) |
| 27 | 27 | */ |
| 28 | 28 | public function __construct() { |
| @@ -29,15 +29,15 @@ | ||
| 29 | 29 | $this->setup_actions(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * Setup the admin hooks, actions and filters. | |
| 33 | + * Setup the admin hooks, actions and filters | |
| 34 | 34 | * |
| 35 | 35 | * @since 2.0.0 bbPress (r2646) |
| 36 | 36 | * |
| 37 | 37 | * @access private |
| 38 | 38 | */ |
| 39 | - private function setup_actions() { | |
| 39 | + function setup_actions() { | |
| 40 | 40 | |
| 41 | 41 | // Bail if in network admin |
| 42 | 42 | if ( is_network_admin() ) { |
| 43 | 43 | return; |
| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | // User profile edit/display actions |
| 47 | 47 | add_action( 'edit_user_profile', array( $this, 'secondary_role_display' ) ); |
| 48 | 48 | |
| 49 | 49 | // WordPress user screen |
| 50 | - // Remove the bottom list table "change forum role" dropdown from WordPress < 4.6. | |
| 50 | + // Remvove the bottom list table "change forum role" dropdown from WordPress < 4.6. | |
| 51 | 51 | // See https://bbpress.trac.wordpress.org/ticket/2906. |
| 52 | 52 | if ( bbp_get_major_wp_version() < 4.6 ) { |
| 53 | 53 | add_action( 'restrict_manage_users', array( __CLASS__, 'user_role_bulk_dropdown' ) ); |
| 54 | 54 | } else { |
| @@ -64,17 +64,12 @@ | ||
| 64 | 64 | |
| 65 | 65 | // User List Table |
| 66 | 66 | add_action( 'load-users.php', array( $this, 'user_role_bulk_change' ), 10, 1 ); |
| 67 | 67 | add_action( 'user_row_actions', array( $this, 'user_row_actions' ), 10, 2 ); |
| 68 | - | |
| 69 | - /** Dependencies ******************************************************/ | |
| 70 | - | |
| 71 | - // Allow plugins to modify these actions | |
| 72 | - do_action_ref_array( 'bbp_admin_users_loaded', array( &$this ) ); | |
| 73 | 68 | } |
| 74 | 69 | |
| 75 | 70 | /** |
| 76 | - * Default interface for setting a forum role. | |
| 71 | + * Default interface for setting a forum role | |
| 77 | 72 | * |
| 78 | 73 | * @since 2.2.0 bbPress (r4285) |
| 79 | 74 | * |
| 80 | 75 | * @param WP_User $profileuser User data |
| @@ -133,9 +128,9 @@ | ||
| 133 | 128 | <?php |
| 134 | 129 | } |
| 135 | 130 | |
| 136 | 131 | /** |
| 137 | - * Add bulk forums role dropdown to the WordPress users table. | |
| 132 | + * Add bulk forums role dropdown to the WordPress users table | |
| 138 | 133 | * |
| 139 | 134 | * @since 2.2.0 bbPress (r4360) |
| 140 | 135 | * @since 2.6.0 bbPress (r6055) Introduced the `$which` parameter. |
| 141 | 136 | * |
| @@ -165,11 +160,11 @@ | ||
| 165 | 160 | $select_id = 'bottom' === $which ? 'bbp-new-role2' : 'bbp-new-role'; |
| 166 | 161 | $button_id = 'bottom' === $which ? 'bbp-change-role2' : 'bbp-change-role'; |
| 167 | 162 | ?> |
| 168 | 163 | |
| 169 | - <label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to…', 'bbpress' ); ?></label> | |
| 164 | + <label class="screen-reader-text" for="<?php echo $select_id; ?>"><?php esc_html_e( 'Change forum role to…', 'bbpress' ) ?></label> | |
| 170 | 165 | <select name="<?php echo $select_id; ?>" id="<?php echo $select_id; ?>" style="display:inline-block; float:none;"> |
| 171 | - <option value=''><?php esc_html_e( 'Change forum role to…', 'bbpress' ); ?></option> | |
| 166 | + <option value=''><?php esc_html_e( 'Change forum role to…', 'bbpress' ) ?></option> | |
| 172 | 167 | <?php foreach ( $dynamic_roles as $role => $details ) : ?> |
| 173 | 168 | <option value="<?php echo esc_attr( $role ); ?>"><?php echo bbp_translate_user_role( $details['name'] ); ?></option> |
| 174 | 169 | <?php endforeach; ?> |
| 175 | 170 | </select><?php submit_button( esc_html__( 'Change', 'bbpress' ), 'secondary', $button_id, false ); |
| @@ -177,11 +172,14 @@ | ||
| 177 | 172 | wp_nonce_field( 'bbp-bulk-users', 'bbp-bulk-users-nonce' ); |
| 178 | 173 | } |
| 179 | 174 | |
| 180 | 175 | /** |
| 181 | - * Process bulk dropdown form submission from the WordPress Users Table. | |
| 176 | + * Process bulk dropdown form submission from the WordPress Users | |
| 177 | + * Table | |
| 182 | 178 | * |
| 183 | 179 | * @since 2.2.0 bbPress (r4365) |
| 180 | + * | |
| 181 | + * @return bool Always false | |
| 184 | 182 | */ |
| 185 | 183 | public function user_role_bulk_change() { |
| 186 | 184 | |
| 187 | 185 | // Bail if no users specified |
| @@ -243,9 +241,9 @@ | ||
| 243 | 241 | } |
| 244 | 242 | } |
| 245 | 243 | |
| 246 | 244 | /** |
| 247 | - * Add a "View" link for each user. | |
| 245 | + * Add a "View" link for each user | |
| 248 | 246 | * |
| 249 | 247 | * @since 2.6.0 bbPress (r6502) |
| 250 | 248 | * |
| 251 | 249 | * @param array $actions |
| @@ -250,9 +248,9 @@ | ||
| 250 | 248 | * |
| 251 | 249 | * @param array $actions |
| 252 | 250 | * @param WP_User $user |
| 253 | 251 | * |
| 254 | - * @return array Actions with 'view' link added to them. | |
| 252 | + * @return array Actions with 'view' link added to them | |
| 255 | 253 | */ |
| 256 | 254 | public function user_row_actions( $actions = array(), $user = false ) { |
| 257 | 255 | |
| 258 | 256 | // Reverse |
| @@ -266,13 +264,13 @@ | ||
| 266 | 264 | } |
| 267 | 265 | |
| 268 | 266 | /** |
| 269 | 267 | * Add Forum Role column to the WordPress Users table, and change the |
| 270 | - * core role title to "Site Role". | |
| 268 | + * core role title to "Site Role" | |
| 271 | 269 | * |
| 272 | 270 | * @since 2.2.0 bbPress (r4337) |
| 273 | 271 | * |
| 274 | - * @param array $columns Users table columns. | |
| 272 | + * @param array $columns Users table columns | |
| 275 | 273 | * @return array $columns |
| 276 | 274 | */ |
| 277 | 275 | public static function user_role_column( $columns = array() ) { |
| 278 | 276 | |
| @@ -293,9 +291,9 @@ | ||
| 293 | 291 | return array_merge( $result, array_slice( $columns, $role_pos ) ); |
| 294 | 292 | } |
| 295 | 293 | |
| 296 | 294 | /** |
| 297 | - * Return user's forums role for display in the WordPress Users list table. | |
| 295 | + * Return user's forums role for display in the WordPress Users list table | |
| 298 | 296 | * |
| 299 | 297 | * @since 2.2.0 bbPress (r4337) |
| 300 | 298 | * |
| 301 | 299 | * @param string $retval |
| @@ -301,9 +299,9 @@ | ||
| 301 | 299 | * @param string $retval |
| 302 | 300 | * @param string $column_name |
| 303 | 301 | * @param int $user_id |
| 304 | 302 | * |
| 305 | - * @return string Displayable bbPress user role. | |
| 303 | + * @return string Displayable bbPress user role | |
| 306 | 304 | */ |
| 307 | 305 | public static function user_role_row( $retval = '', $column_name = '', $user_id = 0 ) { |
| 308 | 306 | |
| 309 | 307 | // User role column |
| @@ -324,12 +322,12 @@ | ||
| 324 | 322 | return $retval; |
| 325 | 323 | } |
| 326 | 324 | |
| 327 | 325 | /** |
| 328 | - * Filter the list of roles included in the WordPress site role list. | |
| 326 | + * Filter the list of roles included in the WordPress site role list | |
| 329 | 327 | * |
| 330 | 328 | * Ensures forum roles are only displayed under the Forum Role list in the |
| 331 | - * WordPress Users list table. | |
| 329 | + * WordPress Users list table | |
| 332 | 330 | * |
| 333 | 331 | * @since 2.6.0 bbPress (r6051) |
| 334 | 332 | * |
| 335 | 333 | * @return array $roles |