diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index d1f4419dde..6a03b8a551 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -840,6 +840,16 @@ class WP_User { update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); + + /** + * Fires immediately after the user has been given a new role. + * + * @since 4.3.0 + * + * @param int $user_id The user ID. + * @param string $role The new role. + */ + do_action( 'add_user_role', $this->ID, $role ); } /** @@ -857,6 +867,16 @@ class WP_User { update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); + + /** + * Fires immediately after a role as been removed from a user. + * + * @since 4.3.0 + * + * @param int $user_id The user ID. + * @param string $role The removed role. + */ + do_action( 'remove_user_role', $this->ID, $role ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 6bfa015477..9cd7bccd8f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32770'; +$wp_version = '4.3-alpha-32771'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.