maybe_hash_hex_color()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
maybe_hash_hex_color( string $color ): string
Описание
В противном случае возвращает значение без изменений.
Этот метод должен требоваться только при использовании sanitize_hex_color_no_hash() .
Оригинал (английский)
Otherwise, returns value untouched.
This method should only be necessary if using sanitize_hex_color_no_hash() .
Параметры
$color
string
обязательный
Возвращаемое значение
string
Исходный код
wp-includes/formatting.php:6288
function maybe_hash_hex_color( $color ) {
$unhashed = sanitize_hex_color_no_hash( $color );
if ( $unhashed ) {
return '#' . $unhashed;
}
return $color;
}
История изменений
| Версия | Описание |
|---|---|
| 3.4.0 | Introduced. |

