From b2eacc3ab12bbf54f43c4fa2f6d9f6ff1aa5f443 Mon Sep 17 00:00:00 2001 From: Rey C Date: Sun, 15 Jun 2025 07:54:58 +0800 Subject: [PATCH] Fix: Adding multiple roles in edit user page is not updating after saving Resolves #406 @polevaultweb --- includes/actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/actions.php b/includes/actions.php index a984d8a3..0bea3cb5 100644 --- a/includes/actions.php +++ b/includes/actions.php @@ -518,7 +518,7 @@ function wpum_register_profile_privacy_fields() { ->set_help_text( esc_html__( 'Hide this profile from members. Overrides the global profile options.', 'wp-user-manager' ) ), ); - if ( $allow_multiple_roles && ( $profileuser || 'user-new.php' === $pagenow ) && ! is_network_admin() ) { + if ( $allow_multiple_roles && ( $profileuser || in_array( $pagenow, array( 'user-new.php', 'user-edit.php' ) ) ) && ! is_network_admin() ) { $fields[] = Field::make( 'multiselect', 'wpum_user_roles', '' ) ->add_options( $roles ) ->set_default_value( $existing_roles )