wpseek.com
A WordPress-centric search engine for devs and theme authors



user_can_edit_user › WordPress Function

Since1.5.0
Deprecated2.0.0
user_can_edit_user ( $user_id, $other_user )
Parameters: (2)
  • (int) $user_id
    Required: Yes
  • (int) $other_user
    Required: Yes
See:
Returns:
  • (bool)
Defined at:
Codex:

Can user can edit other user.



Source

function user_can_edit_user($user_id, $other_user) {
	_deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );

	$user  = get_userdata($user_id);
	$other = get_userdata($other_user);
	if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )
		return true;
	else
		return false;
}