# wp_admin_bar_appearance_menu()

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

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

## Сигнатура

```php
wp_admin_bar_appearance_menu( WP_Admin_Bar $wp_admin_bar )
```

## Описание

Добавляет пункты подменю внешнего вида в меню «Название сайта».

## Параметры

- `$wp_admin_bar` `WP_Admin_Bar` — обязательный. Экземпляр WP_Admin_Bar.

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

Файл: `wp-includes/admin-bar.php:1135`

```php
function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
	$wp_admin_bar->add_group(
		array(
			'parent' => 'site-name',
			'id'     => 'appearance',
		)
	);

	if ( current_user_can( 'switch_themes' ) ) {
		$wp_admin_bar->add_node(
			array(
				'parent' => 'appearance',
				'id'     => 'themes',
				'title'  => __( 'Themes' ),
				'href'   => admin_url( 'themes.php' ),
			)
		);
	}

	if ( ! current_user_can( 'edit_theme_options' ) ) {
		return;
	}

	if ( current_theme_supports( 'widgets' ) ) {
		$wp_admin_bar->add_node(
			array(
				'parent' => 'appearance',
				'id'     => 'widgets',
				'title'  => __( 'Widgets' ),
				'href'   => admin_url( 'widgets.php' ),
			)
		);
	}

	if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
		$wp_admin_bar->add_node(
			array(
				'parent' => 'appearance',
				'id'     => 'menus',
				'title'  => __( 'Menus' ),
				'href'   => admin_url( 'nav-menus.php' ),
			)
		);
	}

	if ( current_theme_supports( 'custom-background' ) ) {
		$wp_admin_bar->add_node(
			array(
				'parent' => 'appearance',
				'id'     => 'background',
				'title'  => _x( 'Background', 'custom background' ),
				'href'   => admin_url( 'themes.php?page=custom-background' ),
				'meta'   => array(
					'class' => 'hide-if-customize',
				),
			)
		);
	}

	if ( current_theme_supports( 'custom-header' ) ) {
		$wp_admin_bar->add_node(
			array(
				'parent' => 'appearance',
				'id'     => 'header',
				'title'  => _x( 'Header', 'custom image header' ),
				'href'   => admin_url( 'themes.php?page=custom-header' ),
				'meta'   => array(
					'class' => 'hide-if-customize',
				),
			)
		);
	}
}
```

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

- 3.1.0 — Introduced.

## Связанные

Использует: `WP_Admin_Bar::add_group`, `WP_Admin_Bar::add_node`, [`current_user_can`](https://chugunov.pro/api-wordpress/functions/current_user_can/), [`current_theme_supports`](https://chugunov.pro/api-wordpress/functions/current_theme_supports/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`_x`](https://chugunov.pro/api-wordpress/functions/_x/), [`admin_url`](https://chugunov.pro/api-wordpress/functions/admin_url/).
Используется в: [`wp_admin_bar_site_menu`](https://chugunov.pro/api-wordpress/functions/wp_admin_bar_site_menu/).

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