WP_REST_Request::canonicalize_header_name
Canonicalizes the header name.
Ensures that header names are always treated the same regardless of source. Header names are always case-insensitive.
Note that we treat - (dashes) and _ (underscores) as the same character, as per header parsing rules in both Apache and nginx.
Метод класса: WP_REST_Request{}
Хуков нет.
Возвращает
string. Canonicalized name.
Использование
$result = WP_REST_Request::canonicalize_header_name( $key );
- $key(строка) (обязательный)
- Header name.
Список изменений
| С версии 4.4.0 | Введена. |
Код WP_REST_Request::canonicalize_header_name() WP REST Request::canonicalize header name WP 7.1.3
public static function canonicalize_header_name( $key ) {
$key = strtolower( $key );
$key = str_replace( '-', '_', $key );
return $key;
}