Title: user_can_edit_user
Published: April 25, 2014
Last modified: August 20, 2026

---

# user_can_edit_user( int $user_id, int $other_user ): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#wp--skip-link--target)

This function has been deprecated since 2.0.0. Use [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)
instead.

Can user can edit other user.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#see-also)󠁿

 * [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#parameters)󠁿

 `$user_id`intrequired

`$other_user`intrequired

## 󠀁[Return](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#return)󠁿

 bool

## 󠀁[Source](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/deprecated.php#L368)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/deprecated.php#L368-L377)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#related)󠁿

| Uses | Description | 
| [get_userdata()](https://developer.wordpress.org/reference/functions/get_userdata/)`wp-includes/pluggable.php` |

Retrieves user info by user ID.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/user_can_edit_user/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Deprecated. Use [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)  | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fuser_can_edit_user%2F)
before being able to contribute a note or feedback.