# get_custom_header_markup()

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

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

## Сигнатура

```php
get_custom_header_markup(): string
```

## Описание

В предпросмотре Настройщика div-контейнер возвращается всегда.

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

`string`

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

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

```php
function get_custom_header_markup() {
	if ( ! has_custom_header() && ! is_customize_preview() ) {
		return '';
	}

	return sprintf(
		'<div id="wp-custom-header" class="wp-custom-header">%s</div>',
		get_header_image_tag()
	);
}
```

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

- 4.7.0 — Introduced.

## Связанные

Использует: [`has_custom_header`](https://chugunov.pro/api-wordpress/functions/has_custom_header/), [`get_header_image_tag`](https://chugunov.pro/api-wordpress/functions/get_header_image_tag/), [`is_customize_preview`](https://chugunov.pro/api-wordpress/functions/is_customize_preview/).
Используется в: [`the_custom_header_markup`](https://chugunov.pro/api-wordpress/functions/the_custom_header_markup/).

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