maybe_hash_hex_color()
Ensures that any hex color is properly hashed. Otherwise, returns value untouched.
This method should only be necessary if using sanitize_hex_color_no_hash().
Хуков нет.
Возвращает
Строку
.
Использование
maybe_hash_hex_color( $color );
- $color(строка) (обязательный)
- -
Список изменений
С версии 3.4.0 | Введена. |
Код maybe_hash_hex_color() maybe hash hex color WP 6.3.1
function maybe_hash_hex_color( $color ) { $unhashed = sanitize_hex_color_no_hash( $color ); if ( $unhashed ) { return '#' . $unhashed; } return $color; }