Make WordPress Core

Changeset 32771


Ignore:
Timestamp:
06/14/2015 07:25:17 PM (9 years ago)
Author:
nacin
Message:

Add add_user_role and remove_user_role actions for WP_User::add_role() and remove_role().

props shooper.
fixes #32060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r32731 r32771  
    841841        $this->get_role_caps();
    842842        $this->update_user_level_from_caps();
     843
     844        /**
     845         * Fires immediately after the user has been given a new role.
     846         *
     847         * @since 4.3.0
     848         *
     849         * @param int    $user_id The user ID.
     850         * @param string $role    The new role.
     851         */
     852        do_action( 'add_user_role', $this->ID, $role );
    843853    }
    844854
     
    858868        $this->get_role_caps();
    859869        $this->update_user_level_from_caps();
     870
     871        /**
     872         * Fires immediately after a role as been removed from a user.
     873         *
     874         * @since 4.3.0
     875         *
     876         * @param int    $user_id The user ID.
     877         * @param string $role    The removed role.
     878         */
     879        do_action( 'remove_user_role', $this->ID, $role );
    860880    }
    861881
Note: See TracChangeset for help on using the changeset viewer.