Warning: This function has been deprecated. Use current_user_can() instead.

user_can_edit_user( int $user_id, int $other_user )

Can user can edit other user.


Description Description

See also See also


Top ↑

Parameters Parameters

$user_id

(int) (Required)

$other_user

(int) (Required)


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: wp-includes/deprecated.php

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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Use current_user_can()
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.