Ticket #2223: 2223.patch
File 2223.patch, 2.1 KB (added by , 12 years ago) |
---|
-
includes/admin/users.php
47 47 return; 48 48 49 49 // User profile edit/display actions 50 add_action( 'edit_user_profile', array( $this, 'secondary_role_display' ) ); 50 add_action( 'edit_user_profile', array( $this, 'secondary_role_display' ) ); 51 add_action( 'user_new_form_after', array( $this, 'secondary_role_display' ) ); 51 52 52 53 // WordPress user screen 53 54 add_action( 'restrict_manage_users', array( $this, 'user_role_bulk_dropdown' ) ); … … 66 67 * @param WP_User $profileuser User data 67 68 * @return bool Always false 68 69 */ 69 public static function secondary_role_display( $profileuser ) {70 public static function secondary_role_display( $profileuser = null ) { 70 71 71 72 // Bail if current user cannot edit users 72 if ( ! current_user_can( 'edit_user', $profileuser->ID ) )73 if ( ! empty( $profileuser ) && ! current_user_can( 'edit_user', $profileuser->ID ) ) 73 74 return; 74 75 75 76 // Get the roles … … 87 88 <th><label for="bbp-forums-role"><?php esc_html_e( 'Forum Role', 'bbpress' ); ?></label></th> 88 89 <td> 89 90 90 <?php $user_role = bbp_get_user_role( $profileuser->ID ); ?>91 <?php $user_role = ! empty( $profileuser ) ? bbp_get_user_role( $profileuser->ID ) : null; ?> 91 92 92 93 <select name="bbp-forums-role" id="bbp-forums-role"> 93 94 -
includes/core/actions.php
51 51 add_action( 'template_redirect', 'bbp_template_redirect', 8 ); // Before BuddyPress's 10 [BB2225] 52 52 add_action( 'login_form_login', 'bbp_login_form_login', 10 ); 53 53 add_action( 'profile_update', 'bbp_profile_update', 10, 2 ); // user_id and old_user_data 54 add_action( 'user_register', 'bbp_profile_update', 10, 1 ); // user_id 54 55 add_action( 'user_register', 'bbp_user_register', 10 ); 55 56 56 57 /**