Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Logger
- wp_fusion()->logger->handle( 'info', $user_id, 'Removing Ultimate Member role <strong>' . $label . '</strong> from linked tag <strong>' . wp_fusion()->user->get_tag_label( $tag_id ) . '</strong>', array( 'source' => 'ultimate-member' ) );
- $user->remove_role( $slug );
- if ( empty( $user->roles ) ) {
- // We don't want to leave someone with no role so we'll assign the UM default role
- $default_role = UM()->options()->get( 'register_role' );
- if ( empty( $default_role ) ) {
- $default_role = get_option( 'default_role' );
- }
- wp_fusion()->logger->handle( 'info', $user_id, 'User was left with no role so assigning default role <strong>' . $default_role . '</strong>.', array( 'source' => 'ultimate-member' ) );
- um_fetch_user( $user_id );
- UM()->roles()->set_role( $user_id, $default_role );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement