Change WordPress user roles and capabilities Forums How to or FAQ Two roles assigned multiple roles

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6814
    tadpole
    Participant

    Hi,

    Is there a way to automatically assign a second role to two different. I am setting up different registration processes for different roles, so:

  • Store Manager – auto assign Support Agent
  • Store Staff – auto assign Support Agent
  • Customer – auto assign Support User
  • Any insight on this would be appreciated.

#6819
Vladimir
Keymaster

Custom code may help only. New user is registered via WordPress internal function wp_insert_user(). This function executes special action:


		/**
		 * Fires immediately after a new user is registered.
		 *
		 * @since 1.5.0
		 *
		 * @param int $user_id User ID.
		 */
		do_action( 'user_register', $user_id );

Thus, it’s possible to hook own function to ‘user_register’ action and add secondary role to user according to his primary role.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.