# self_admin_url()

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

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

## Сигнатура

```php
self_admin_url( string $path = '', string $scheme = 'admin' ): string
```

## Описание

Получает URL административной части либо для текущего сайта, либо для сети в зависимости от контекста.

## Параметры

- `$path` `string` — необязательный, по умолчанию `''`. Путь относительно URL административной части.
- `$scheme` `string` — необязательный, по умолчанию `'admin'`. Используемая схема. Значение по умолчанию 'admin', которое подчиняется force_ssl_admin() и is_ssl() . Можно передать 'http' или 'https', чтобы принудительно задать эти схемы.

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

`string`

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

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

```php
function self_admin_url( $path = '', $scheme = 'admin' ) {
	if ( is_network_admin() ) {
		$url = network_admin_url( $path, $scheme );
	} elseif ( is_user_admin() ) {
		$url = user_admin_url( $path, $scheme );
	} else {
		$url = admin_url( $path, $scheme );
	}

	/**
	 * Filters the admin URL for the current site or network depending on context.
	 *
	 * @since 4.9.0
	 *
	 * @param string $url    The complete URL including scheme and path.
	 * @param string $path   Path relative to the URL. Blank string if no path is specified.
	 * @param string $scheme The scheme to use.
	 */
	return apply_filters( 'self_admin_url', $url, $path, $scheme );
}
```

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

- 3.1.0 — Introduced.

## Связанные

Использует: [`is_network_admin`](https://chugunov.pro/api-wordpress/functions/is_network_admin/), [`is_user_admin`](https://chugunov.pro/api-wordpress/functions/is_user_admin/), [`network_admin_url`](https://chugunov.pro/api-wordpress/functions/network_admin_url/), [`user_admin_url`](https://chugunov.pro/api-wordpress/functions/user_admin_url/), [`admin_url`](https://chugunov.pro/api-wordpress/functions/admin_url/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`core_auto_updates_settings`](https://chugunov.pro/api-wordpress/functions/core_auto_updates_settings/), `WP_REST_Plugins_Controller::is_filesystem_available`, [`do_block_editor_incompatible_meta_box`](https://chugunov.pro/api-wordpress/functions/do_block_editor_incompatible_meta_box/), [`wp_load_press_this`](https://chugunov.pro/api-wordpress/functions/wp_load_press_this/), [`wp_print_plugin_file_tree`](https://chugunov.pro/api-wordpress/functions/wp_print_plugin_file_tree/), [`wp_print_theme_file_tree`](https://chugunov.pro/api-wordpress/functions/wp_print_theme_file_tree/), `WP_Customize_Manager::customize_pane_settings`, `WP_Customize_Theme_Control::content_template`, [`customize_themes_print_templates`](https://chugunov.pro/api-wordpress/functions/customize_themes_print_templates/), [`wp_print_request_filesystem_credentials_modal`](https://chugunov.pro/api-wordpress/functions/wp_print_request_filesystem_credentials_modal/), `File_Upload_Upgrader::__construct`, `WP_Plugins_List_Table::single_row`, [`install_themes_upload`](https://chugunov.pro/api-wordpress/functions/install_themes_upload/), `Language_Pack_Upgrader_Skin::bulk_footer`, `Theme_Upgrader_Skin::after`, `Bulk_Theme_Upgrader_Skin::bulk_footer`, `Plugin_Installer_Skin::after`, `Theme_Installer_Skin::after`, `Bulk_Plugin_Upgrader_Skin::bulk_footer`, `Plugin_Upgrader_Skin::after`, [`update_option_new_admin_email`](https://chugunov.pro/api-wordpress/functions/update_option_new_admin_email/), [`send_confirmation_on_profile_email`](https://chugunov.pro/api-wordpress/functions/send_confirmation_on_profile_email/), `WP_Theme_Install_List_Table::install_theme_info`, `WP_Theme_Install_List_Table::get_views`, `WP_Theme_Install_List_Table::single_row`, [`wp_plugin_update_row`](https://chugunov.pro/api-wordpress/functions/wp_plugin_update_row/), [`wp_theme_update_row`](https://chugunov.pro/api-wordpress/functions/wp_theme_update_row/), [`install_dashboard`](https://chugunov.pro/api-wordpress/functions/install_dashboard/), [`install_plugins_upload`](https://chugunov.pro/api-wordpress/functions/install_plugins_upload/), [`install_plugin_install_status`](https://chugunov.pro/api-wordpress/functions/install_plugin_install_status/), [`install_plugin_information`](https://chugunov.pro/api-wordpress/functions/install_plugin_information/), `WP_Plugin_Install_List_Table::display_rows`, `WP_Plugin_Install_List_Table::get_views`, [`wp_link_manager_disabled_message`](https://chugunov.pro/api-wordpress/functions/wp_link_manager_disabled_message/), [`core_upgrade_preamble`](https://chugunov.pro/api-wordpress/functions/core_upgrade_preamble/), [`list_plugin_updates`](https://chugunov.pro/api-wordpress/functions/list_plugin_updates/), [`list_theme_updates`](https://chugunov.pro/api-wordpress/functions/list_theme_updates/), [`do_core_upgrade`](https://chugunov.pro/api-wordpress/functions/do_core_upgrade/), [`get_edit_user_link`](https://chugunov.pro/api-wordpress/functions/get_edit_user_link/), [`wp_admin_bar_wp_menu`](https://chugunov.pro/api-wordpress/functions/wp_admin_bar_wp_menu/).

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