) );
foreach( $args as $key => $arg ) {
- $args[$key] = self::get_user_from_first_arg( $arg )->ID;
+ $args[$key] = self::get_user( $arg )->ID;
}
parent::delete( $args, $assoc_args );
}
public function update( $args, $assoc_args ) {
foreach( $args as $key => $arg ) {
- $args[$key] = self::get_user_from_first_arg( $arg )->ID;
+ $args[$key] = self::get_user( $arg )->ID;
}
parent::update( $args, $assoc_args, 'user' );
}
* @synopsis <user> [<role>]
*/
public function set_role( $args, $assoc_args ) {
- $user = self::get_user_from_first_arg( $args[0] );
+ $user = self::get_user( $args[0] );
$role = isset( $args[1] ) ? $args[1] : get_option( 'default_role' );
* @synopsis <user> <role>
*/
public function add_role( $args, $assoc_args ) {
- $user = self::get_user_from_first_arg( $args[0] );
+ $user = self::get_user( $args[0] );
$role = $args[1];
* @synopsis <user> [<role>]
*/
public function remove_role( $args, $assoc_args ) {
- $user = self::get_user_from_first_arg( $args[0] );
+ $user = self::get_user( $args[0] );
if ( isset( $args[1] ) ) {
$role = $args[1];
}
}
- private static function get_user_from_first_arg( $id_or_login ) {
+ private static function get_user( $id_or_login ) {
if ( is_numeric( $id_or_login ) )
$user = get_user_by( 'id', $id_or_login );
else