WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_REST_Request::get_header() WP 4.4.0

Retrieves the given header from the request.

If the header has multiple values, they will be concatenated with a comma as per the HTTP specification. Be aware that some non-compliant headers (notably cookie headers) cannot be joined this way.

Это метод класса: WP_REST_Request

Хуков нет.


Строку/null. String value if set, null otherwise.


$WP_REST_Request = new WP_REST_Request();
$var = $WP_REST_Request->get_header( $key );
$key(строка) (обязательный)
Header name, will be canonicalized to lowercase.

Список изменений

С версии 4.4.0 Введена.

Код WP REST Request::get header: wp-includes/rest-api/class-wp-rest-request.php WP 5.2.4

public function get_header( $key ) {
	$key = $this->canonicalize_header_name( $key );

	if ( ! isset( $this->headers[ $key ] ) ) {
		return null;

	return implode( ',', $this->headers[ $key ] );