Yoast\WP\SEO\Abilities\User_Interface\Abilities

Update_Author_Schema_Ability::can_edit_user │ public │ Yoast 1.0

Checks whether the current user can edit the given user.

Gates the ability behind the same capability that gates the user profile page and the person social profiles of the first-time configuration, so users can edit their own settings and admins anyone's.

Метод класса: Update_Author_Schema_Ability{}

Хуков нет.

Возвращает

bool. Whether the current user can edit the given user.

Использование

$Update_Author_Schema_Ability = new Update_Author_Schema_Ability();
$Update_Author_Schema_Ability->can_edit_user( $input ): bool;
$input(array<string, mixed>) (обязательный)
The ability input, which identifies the user.

Код Update_Author_Schema_Ability::can_edit_user() Yoast 28.9

public function can_edit_user( array $input ): bool {
	return \current_user_can( 'edit_user', (int) ( $input['user_id'] ?? 0 ) );
}