# get_header_video_url()

URL: https://chugunov.pro/api-wordpress/functions/get_header_video_url/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 4.7.0.

## Сигнатура

```php
get_header_video_url(): string|false
```

## Описание

Использует локальное видео, если оно есть, иначе переходит к внешнему видео.

## Возвращаемое значение

`string|false`

## Исходный код

Файл: `wp-includes/theme.php:1661`

```php
function get_header_video_url() {
	$id = absint( get_theme_mod( 'header_video' ) );

	if ( $id ) {
		// Get the file URL from the attachment ID.
		$url = wp_get_attachment_url( $id );
	} else {
		$url = get_theme_mod( 'external_header_video' );
	}

	/**
	 * Filters the header video URL.
	 *
	 * @since 4.7.3
	 *
	 * @param string $url Header video URL, if available.
	 */
	$url = apply_filters( 'get_header_video_url', $url );

	if ( ! $id && ! $url ) {
		return false;
	}

	return sanitize_url( set_url_scheme( $url ) );
}
```

## История изменений

- 4.7.0 — Introduced.

## Связанные

Использует: [`get_theme_mod`](https://chugunov.pro/api-wordpress/functions/get_theme_mod/), [`set_url_scheme`](https://chugunov.pro/api-wordpress/functions/set_url_scheme/), [`wp_get_attachment_url`](https://chugunov.pro/api-wordpress/functions/wp_get_attachment_url/), [`sanitize_url`](https://chugunov.pro/api-wordpress/functions/sanitize_url/), [`absint`](https://chugunov.pro/api-wordpress/functions/absint/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`has_header_video`](https://chugunov.pro/api-wordpress/functions/has_header_video/), [`the_header_video_url`](https://chugunov.pro/api-wordpress/functions/the_header_video_url/), [`get_header_video_settings`](https://chugunov.pro/api-wordpress/functions/get_header_video_settings/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/get_header_video_url/
