# get_bloginfo()

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

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

## Сигнатура

```php
get_bloginfo( string $show = '', string $filter = 'raw' ): string
```

## Описание

Возможные значения $show:

‘name’ – Название сайта (задаётся в «Настройки > Общие»)

‘description’ – Краткое описание сайта (задаётся в «Настройки > Общие»)

‘wpurl’ – Адрес WordPress (URL) (задаётся в «Настройки > Общие»)

‘url’ – Адрес сайта (URL) (задаётся в «Настройки > Общие»)

‘admin_email’ – Email администратора (задаётся в «Настройки > Общие»)

‘charset’ – «Кодировка страниц и лент» (задаётся в «Настройки > Чтение»)

‘version’ – Текущая версия WordPress

‘html_type’ – Content-Type (по умолчанию: «text/html»). Темы и плагины могут переопределить значение по умолчанию с помощью фильтра ‘pre_option_html_type’

‘text_direction’ – Направление текста, определяемое языком сайта. Вместо этого следует использовать is_rtl()

‘language’ – Код языка текущего сайта

‘stylesheet_url’ – URL таблицы стилей активной темы. Активная дочерняя тема имеет приоритет над этим значением

‘stylesheet_directory’ – Путь к каталогу активной темы. Активная дочерняя тема имеет приоритет над этим значением

‘template_url’ / ‘template_directory’ – URL каталога активной темы. Активная дочерняя тема НЕ имеет приоритета над этим значением

‘pingback_url’ – URL файла XML-RPC для пингбэков (xmlrpc.php)

‘atom_url’ – URL Atom-ленты (/feed/atom)

‘rdf_url’ – URL ленты RDF/RSS 1.0 (/feed/rdf)

‘rss_url’ – URL ленты RSS 0.92 (/feed/rss)

‘rss2_url’ – URL ленты RSS 2.0 (/feed)

‘comments_atom_url’ – URL Atom-ленты комментариев (/comments/feed)

‘comments_rss2_url’ – URL ленты RSS 2.0 комментариев (/comments/feed)

Некоторые значения $show устарели и будут удалены в будущих версиях.
Эти опции вызовут срабатывание функции _deprecated_argument().
К устаревшим аргументам относятся:

‘siteurl’ – Используйте ‘url’

‘home’ – Используйте ‘url’

## Параметры

- `$show` `string` — необязательный, по умолчанию `''`. Информация о сайте для получения. Значение по умолчанию — пусто (название сайта).
- `$filter` `string` — необязательный, по умолчанию `'raw'`. Как фильтровать получаемое значение. Значение по умолчанию 'raw'.

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

`string`

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

Файл: `wp-includes/general-template.php:816`

```php
function get_bloginfo( $show = '', $filter = 'raw' ) {
	switch ( $show ) {
		case 'home':    // Deprecated.
		case 'siteurl': // Deprecated.
			_deprecated_argument(
				__FUNCTION__,
				'2.2.0',
				sprintf(
					/* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument. */
					__( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ),
					'<code>' . $show . '</code>',
					'<code>bloginfo()</code>',
					'<code>url</code>'
				)
			);
			// Intentional fall-through to be handled by the 'url' case.
		case 'url':
			$output = home_url();
			break;
		case 'wpurl':
			$output = site_url();
			break;
		case 'description':
			$output = get_option( 'blogdescription' );
			break;
		case 'rdf_url':
			$output = get_feed_link( 'rdf' );
			break;
		case 'rss_url':
			$output = get_feed_link( 'rss' );
			break;
		case 'rss2_url':
			$output = get_feed_link( 'rss2' );
			break;
		case 'atom_url':
			$output = get_feed_link( 'atom' );
			break;
		case 'comments_atom_url':
			$output = get_feed_link( 'comments_atom' );
			break;
		case 'comments_rss2_url':
			$output = get_feed_link( 'comments_rss2' );
			break;
		case 'pingback_url':
			$output = site_url( 'xmlrpc.php' );
			break;
		case 'stylesheet_url':
			$output = get_stylesheet_uri();
			break;
		case 'stylesheet_directory':
			$output = get_stylesheet_directory_uri();
			break;
		case 'template_directory':
		case 'template_url':
			$output = get_template_directory_uri();
			break;
		case 'admin_email':
			$output = get_option( 'admin_email' );
			break;
		case 'charset':
			$output = get_option( 'blog_charset' );
			if ( '' === $output ) {
				$output = 'UTF-8';
			}
			break;
		case 'html_type':
			$output = get_option( 'html_type' );
			break;
		case 'version':
			global $wp_version;
			$output = $wp_version;
			break;
		case 'language':
			/*
			 * translators: Translate this to the correct language tag for your locale,
			 * see https://www.w3.org/International/articles/language-tags/ for reference.
			 * Do not translate into your own language.
			 */
			$output = __( 'html_lang_attribute' );
			if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) {
				$output = determine_locale();
				$output = str_replace( '_', '-', $output );
			}
			break;
		case 'text_direction':
			_deprecated_argument(
				__FUNCTION__,
				'2.2.0',
				sprintf(
					/* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name. */
					__( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ),
					'<code>' . $show . '</code>',
					'<code>bloginfo()</code>',
					'<code>is_rtl()</code>'
				)
			);
			if ( function_exists( 'is_rtl' ) ) {
				$output = is_rtl() ? 'rtl' : 'ltr';
			} else {
				$output = 'ltr';
			}
			break;
		case 'name':
		default:
			$output = get_option( 'blogname' );
			break;
	}

	if ( 'display' === $filter ) {
		if (
			str_contains( $show, 'url' )
			|| str_contains( $show, 'directory' )
			|| str_contains( $show, 'home' )
		) {
			/**
			 * Filters the URL returned by get_bloginfo().
			 *
			 * @since 2.0.5
			 *
			 * @param string $output The URL returned by bloginfo().
			 * @param string $show   Type of information requested.
			 */
			$output = apply_filters( 'bloginfo_url', $output, $show );
		} else {
			/**
			 * Filters the site information returned by get_bloginfo().
			 *
			 * @since 0.71
			 *
			 * @param mixed  $output The requested non-URL site information.
			 * @param string $show   Type of information requested.
			 */
			$output = apply_filters( 'bloginfo', $output, $show );
		}
	}

	return $output;
}
```

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

- 0.71 — Introduced.

## Связанные

Использует: [`determine_locale`](https://chugunov.pro/api-wordpress/functions/determine_locale/), [`get_stylesheet_uri`](https://chugunov.pro/api-wordpress/functions/get_stylesheet_uri/), [`get_stylesheet_directory_uri`](https://chugunov.pro/api-wordpress/functions/get_stylesheet_directory_uri/), [`get_template_directory_uri`](https://chugunov.pro/api-wordpress/functions/get_template_directory_uri/), [`is_rtl`](https://chugunov.pro/api-wordpress/functions/is_rtl/), [`site_url`](https://chugunov.pro/api-wordpress/functions/site_url/), [`get_feed_link`](https://chugunov.pro/api-wordpress/functions/get_feed_link/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`_deprecated_argument`](https://chugunov.pro/api-wordpress/functions/_deprecated_argument/), [`home_url`](https://chugunov.pro/api-wordpress/functions/home_url/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/), [`get_option`](https://chugunov.pro/api-wordpress/functions/get_option/).
Используется в: `WP_Debug_Data::get_wp_core`, `WP_Customize_Nav_Menu_Item_Setting::js_value`, [`wp_register_core_abilities`](https://chugunov.pro/api-wordpress/functions/wp_register_core_abilities/), `WP_Script_Modules::get_src`, `WP_REST_Templates_Controller::get_wp_templates_author_text_field`, `WP_REST_URL_Details_Controller::prepare_metadata_for_output`, `WP_REST_URL_Details_Controller::get_remote_url`, `WP_REST_Widget_Types_Controller::get_widgets`, `WP_Recovery_Mode_Email_Service::get_debug`, [`validate_plugin_requirements`](https://chugunov.pro/api-wordpress/functions/validate_plugin_requirements/), `WP_Privacy_Policy_Content::get_default_content`, [`wp_privacy_generate_personal_data_export_file`](https://chugunov.pro/api-wordpress/functions/wp_privacy_generate_personal_data_export_file/), `WP_Widget_Text::is_legacy_instance`, `_WP_Editors::default_settings`, [`the_embed_site_title`](https://chugunov.pro/api-wordpress/functions/the_embed_site_title/), [`get_custom_logo`](https://chugunov.pro/api-wordpress/functions/get_custom_logo/), `WP_Customize_Site_Icon_Control::content_template`, [`get_post_embed_html`](https://chugunov.pro/api-wordpress/functions/get_post_embed_html/), [`get_oembed_response_data`](https://chugunov.pro/api-wordpress/functions/get_oembed_response_data/), [`wp_get_document_title`](https://chugunov.pro/api-wordpress/functions/wp_get_document_title/), [`get_language_attributes`](https://chugunov.pro/api-wordpress/functions/get_language_attributes/), `WP_Customize_Nav_Menus::search_available_items_query`, `WP_Customize_Nav_Menus::customize_register`, `WP_Customize_Nav_Menus::load_available_items_query`, `WP_Customize_Media_Control::to_json`, [`wp_install_maybe_enable_pretty_permalinks`](https://chugunov.pro/api-wordpress/functions/wp_install_maybe_enable_pretty_permalinks/), `WP_Customize_Panel::json`, `WP_Customize_Section::json`, [`wpview_media_sandbox_styles`](https://chugunov.pro/api-wordpress/functions/wpview_media_sandbox_styles/), [`login_footer`](https://chugunov.pro/api-wordpress/functions/login_footer/), [`login_header`](https://chugunov.pro/api-wordpress/functions/login_header/), `WP_Automatic_Updater::send_email`, `WP_Automatic_Updater::send_debug_email`, [`export_wp`](https://chugunov.pro/api-wordpress/functions/export_wp/), [`_access_denied_splash`](https://chugunov.pro/api-wordpress/functions/_access_denied_splash/), [`core_update_footer`](https://chugunov.pro/api-wordpress/functions/core_update_footer/), [`update_right_now_message`](https://chugunov.pro/api-wordpress/functions/update_right_now_message/), [`install_plugin_information`](https://chugunov.pro/api-wordpress/functions/install_plugin_information/), `WP_Plugin_Install_List_Table::display_rows`, `WP_Plugin_Install_List_Table::prepare_items`.

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