# content_url()

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

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

## Сигнатура

```php
content_url( string $path = '' ): string
```

## Описание

Получает URL каталога с контентом.

## Параметры

- `$path` `string` — необязательный, по умолчанию `''`. Путь относительно URL каталога с контентом.

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

`string`

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

Файл: `wp-includes/link-template.php:3651`

```php
function content_url( $path = '' ) {
	$url = set_url_scheme( WP_CONTENT_URL );

	if ( $path && is_string( $path ) ) {
		$url .= '/' . ltrim( $path, '/' );
	}

	/**
	 * Filters the URL to the content directory.
	 *
	 * @since 2.8.0
	 *
	 * @param string $url  The complete URL to the content directory including scheme and path.
	 * @param string $path Path relative to the URL to the content directory. Blank string
	 *                     if no path is specified.
	 */
	return apply_filters( 'content_url', $url, $path );
}
```

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

- 2.6.0 — Introduced.

## Связанные

Использует: [`set_url_scheme`](https://chugunov.pro/api-wordpress/functions/set_url_scheme/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`_load_script_textdomain_from_src`](https://chugunov.pro/api-wordpress/functions/_load_script_textdomain_from_src/), `WP_URL_Pattern_Prefixer::get_default_contexts`, [`get_theme_root_uri`](https://chugunov.pro/api-wordpress/functions/get_theme_root_uri/), `_WP_Editors::editor_settings`.

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