On this page
user_can_edit_user( int $user_id, int $other_user ): bool
This function has been deprecated. Use current_user_can() instead.
Can user can edit other user.
Description
See also
Parameters
$user_idint Required$other_userint Required
Return
bool
Source
File: wp-includes/deprecated.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| get_userdata() wp-includes/pluggable.php | Retrieves user info by user ID. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Use current_user_can() |
| 1.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/user_can_edit_user