# __checked_selected_helper()

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

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

## Сигнатура

```php
__checked_selected_helper( mixed $helper, mixed $current, bool $display, string $type ): string
```

## Описание

Сравнивает первые два аргумента и, если они идентичны, помечает как $type.

## Параметры

- `$helper` `mixed` — обязательный. Одно из сравниваемых значений.
- `$current` `mixed` — обязательный. Другое значение для сравнения, если это не просто true.
- `$display` `bool` — обязательный. Выводить строку или просто возвращать её.
- `$type` `string` — обязательный. Тип выполняемой операции checked|selected|disabled|readonly.

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

`string`

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

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

```php
function __checked_selected_helper( $helper, $current, $display, $type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
	if ( (string) $helper === (string) $current ) {
		$result = " $type='$type'";
	} else {
		$result = '';
	}

	if ( $display ) {
		echo $result;
	}

	return $result;
}
```

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

- 2.8.0 — Introduced.

## Связанные

Используется в: [`wp_readonly`](https://chugunov.pro/api-wordpress/functions/wp_readonly/), [`checked`](https://chugunov.pro/api-wordpress/functions/checked/), [`selected`](https://chugunov.pro/api-wordpress/functions/selected/), [`disabled`](https://chugunov.pro/api-wordpress/functions/disabled/).

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