diff -r c7c0fbc09788 -r 5e8dcbe22c24 web/wp-content/plugins/bbpress/includes/admin/users.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/bbpress/includes/admin/users.php Tue Dec 04 18:43:10 2012 -0800 @@ -0,0 +1,254 @@ +setup_actions(); + } + + /** + * Setup the admin hooks, actions and filters + * + * @since bbPress (r2646) + * @access private + * + * @uses add_action() To add various actions + */ + function setup_actions() { + + // Bail if in network admin + if ( is_network_admin() ) + return; + + // User profile edit/display actions + add_action( 'edit_user_profile', array( $this, 'secondary_role_display' ) ); + + // WordPress user screen + add_action( 'restrict_manage_users', array( $this, 'user_role_bulk_dropdown' ) ); + add_filter( 'manage_users_columns', array( $this, 'user_role_column' ) ); + add_filter( 'manage_users_custom_column', array( $this, 'user_role_row' ), 10, 3 ); + + // Process bulk role change + add_action( 'load-users.php', array( $this, 'user_role_bulk_change' ) ); + } + + /** + * Default interface for setting a forum role + * + * @since bbPress (r4285) + * + * @param WP_User $profileuser User data + * @return bool Always false + */ + public static function secondary_role_display( $profileuser ) { + + // Bail if current user cannot edit users + if ( ! current_user_can( 'edit_user', $profileuser->ID ) ) + return; + + // Get the roles + $dynamic_roles = bbp_get_dynamic_roles(); + + // Only keymasters can set other keymasters + if ( ! current_user_can( 'keep_gate' ) ) + unset( $dynamic_roles[ bbp_get_keymaster_role() ] ); ?> + +
+ ++ | + + ID ); ?> + + + | +
---|