Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: set_user_role

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
611            * Fires after the user's role has changed.
612            *
613            * @since 2.9.0
614            * @since 3.6.0 Added $old_roles to include an array of the user's previous roles.
615            *
616            * @param int      $user_id   The user ID.
617            * @param string   $role      The new role.
618            * @param string[] $old_roles An array of the user's previous roles.
619            */
620           do_action( 'set_user_role', $this->ID, $role, $old_roles );
621      }
622
623      /**
624       * Choose the maximum level the user has.
625       *
626       * Will compare the level from the $item parameter against the $max
627       * parameter. If the item is incorrect, then just the $max parameter value
628       * will be returned.
629       *