# user_can_richedit()

URL: https://chugunov.pro/api-wordpress/functions/user_can_richedit/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.0.0.

## Сигнатура

```php
user_can_richedit(): bool
```

## Описание

Проверяет, есть ли у пользователя доступ к визуальному редактору и поддерживается ли он браузером пользователя.

## Возвращаемое значение

`bool`

## Исходный код

Файл: `wp-includes/general-template.php:3917`

```php
function user_can_richedit() {
	global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE, $is_edge;

	if ( ! isset( $wp_rich_edit ) ) {
		$wp_rich_edit = false;

		if ( 'true' === get_user_option( 'rich_editing' ) || ! is_user_logged_in() ) { // Default to 'true' for logged out users.
			if ( $is_safari ) {
				$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && (int) $match[1] >= 534 );
			} elseif ( $is_IE ) {
				$wp_rich_edit = str_contains( $_SERVER['HTTP_USER_AGENT'], 'Trident/7.0;' );
			} elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && ! wp_is_mobile() ) ) {
				$wp_rich_edit = true;
			}
		}
	}

	/**
	 * Filters whether the user can access the visual editor.
	 *
	 * @since 2.1.0
	 *
	 * @param bool $wp_rich_edit Whether the user can access the visual editor.
	 */
	return apply_filters( 'user_can_richedit', $wp_rich_edit );
}
```

## История изменений

- 2.0.0 — Introduced.

## Связанные

Использует: [`wp_is_mobile`](https://chugunov.pro/api-wordpress/functions/wp_is_mobile/), [`get_user_option`](https://chugunov.pro/api-wordpress/functions/get_user_option/), [`is_user_logged_in`](https://chugunov.pro/api-wordpress/functions/is_user_logged_in/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: `_WP_Editors::print_default_editor_scripts`, [`get_media_item`](https://chugunov.pro/api-wordpress/functions/get_media_item/), [`get_compat_media_markup`](https://chugunov.pro/api-wordpress/functions/get_compat_media_markup/), [`wp_default_editor`](https://chugunov.pro/api-wordpress/functions/wp_default_editor/), `WP_Widget_Text::form`, [`sanitize_post_field`](https://chugunov.pro/api-wordpress/functions/sanitize_post_field/), `_WP_Editors::parse_settings`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/user_can_richedit/
