On this page
self_admin_url( string $path = '', string $scheme = 'admin' ): string
Retrieves the URL to the admin area for either the current site or the network depending on context.
Parameters
$pathstring Optional-
Path relative to the admin URL.
Default:
'' $schemestring Optional-
The scheme to use. Default is
'admin', which obeys force_ssl_admin() and is_ssl() .'http'or'https'can be passed to force those schemes.Default:
'admin'
Return
string Admin URL link with optional path appended.
Source
File: wp-includes/link-template.php. View all references
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 );
}
Hooks
- apply_filters( 'self_admin_url',
string $url ,string $path ,string $scheme ) -
Filters the admin URL for the current site or network depending on context.
Related
Uses
| Uses | Description |
|---|---|
| is_network_admin() wp-includes/load.php | Determines whether the current request is for the network administrative interface. |
| is_user_admin() wp-includes/load.php | Determines whether the current request is for a user admin screen. |
| network_admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the network. |
| user_admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the current user. |
| admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the current site. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
Used By
| Used By | Description |
|---|---|
| core_auto_updates_settings() wp-admin/update-core.php | Display WordPress auto-updates settings. |
| WP_REST_Plugins_Controller::is_filesystem_available() wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php | Determine if the endpoints are available. |
| do_block_editor_incompatible_meta_box() wp-admin/includes/template.php | Renders a “fake” meta box with an information message, shown on the block editor, when an incompatible meta box is found. |
| wp_load_press_this() wp-admin/press-this.php | |
| wp_print_plugin_file_tree() wp-admin/includes/misc.php | Outputs the formatted file list for the plugin file editor. |
| wp_print_theme_file_tree() wp-admin/includes/misc.php | Outputs the formatted file list for the theme file editor. |
| WP_Customize_Manager::customize_pane_settings() wp-includes/class-wp-customize-manager.php | Prints JavaScript settings for parent window. |
| WP_Customize_Theme_Control::content_template() wp-includes/customize/class-wp-customize-theme-control.php | Render a JS template for theme display. |
| customize_themes_print_templates() wp-admin/includes/theme.php | Prints JS templates for the theme-browsing UI in the Customizer. |
| wp_print_request_filesystem_credentials_modal() wp-admin/includes/file.php | Prints the filesystem credentials modal when needed. |
| WP_Plugins_List_Table::single_row() wp-admin/includes/class-wp-plugins-list-table.php | |
| install_themes_upload() wp-admin/includes/theme-install.php | Displays a form to upload themes from zip files. |
| Language_Pack_Upgrader_Skin::bulk_footer() wp-admin/includes/class-language-pack-upgrader-skin.php | |
| Theme_Upgrader_Skin::after() wp-admin/includes/class-theme-upgrader-skin.php | Action to perform following a single theme update. |
| Plugin_Installer_Skin::after() wp-admin/includes/class-plugin-installer-skin.php | Action to perform following a plugin install. |
| Theme_Installer_Skin::after() wp-admin/includes/class-theme-installer-skin.php | Action to perform following a single theme install. |
| Bulk_Theme_Upgrader_Skin::bulk_footer() wp-admin/includes/class-bulk-theme-upgrader-skin.php | |
| Bulk_Plugin_Upgrader_Skin::bulk_footer() wp-admin/includes/class-bulk-plugin-upgrader-skin.php | |
| Plugin_Upgrader_Skin::after() wp-admin/includes/class-plugin-upgrader-skin.php | Action to perform following a single plugin update. |
| update_option_new_admin_email() wp-admin/includes/misc.php | Sends a confirmation request email when a change of site admin email address is attempted. |
| WP_Theme_Install_List_Table::install_theme_info() wp-admin/includes/class-wp-theme-install-list-table.php | Prints the info for a theme (to be used in the theme installer modal). |
| WP_Theme_Install_List_Table::get_views() wp-admin/includes/class-wp-theme-install-list-table.php | |
| WP_Theme_Install_List_Table::single_row() wp-admin/includes/class-wp-theme-install-list-table.php | Prints a theme from the WordPress.org API. |
| wp_plugin_update_row() wp-admin/includes/update.php | Displays update information for a plugin. |
| wp_theme_update_row() wp-admin/includes/update.php | Displays update information for a theme. |
| install_dashboard() wp-admin/includes/plugin-install.php | Displays the Featured tab of Add Plugins screen. |
| install_plugins_upload() wp-admin/includes/plugin-install.php | Displays a form to upload plugins from zip files. |
| install_plugin_install_status() wp-admin/includes/plugin-install.php | Determines the status we can perform on a plugin. |
| install_plugin_information() wp-admin/includes/plugin-install.php | Displays plugin information in dialog box form. |
| WP_Plugin_Install_List_Table::display_rows() wp-admin/includes/class-wp-plugin-install-list-table.php | |
| WP_Plugin_Install_List_Table::get_views() wp-admin/includes/class-wp-plugin-install-list-table.php | |
| wp_link_manager_disabled_message() wp-admin/includes/bookmark.php | Outputs the ‘disabled’ message for the WordPress Link Manager. |
| core_upgrade_preamble() wp-admin/update-core.php | Display upgrade WordPress for downloading latest or upgrading automatically form. |
| list_plugin_updates() wp-admin/update-core.php | Display the upgrade plugins form. |
| list_theme_updates() wp-admin/update-core.php | Display the upgrade themes form. |
| do_core_upgrade() wp-admin/update-core.php | Upgrade WordPress core display. |
| get_edit_user_link() wp-includes/link-template.php | Retrieves the edit user link. |
| wp_admin_bar_wp_menu() wp-includes/admin-bar.php | Adds the WordPress logo menu. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/self_admin_url