функция
since 2.8.0
__checked_selected_helper()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
__checked_selected_helper( mixed $helper, mixed $current, bool $display, string $type ): string
Описание
Сравнивает первые два аргумента и, если они идентичны, помечает как $type.
Оригинал (английский)
Compares the first two arguments and if identical marks as $type.
Параметры
$helper
mixed
обязательный
Одно из сравниваемых значений.
$current
mixed
обязательный
Другое значение для сравнения, если это не просто true.
$display
bool
обязательный
Выводить строку или просто возвращать её.
$type
string
обязательный
Тип выполняемой операции checked|selected|disabled|readonly.
Возвращаемое значение
string
Исходный код
wp-includes/general-template.php:5361
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. |

