Languages: English • 日本語 (Add your language)
The admin_url template tag retrieves the url to the admin area for the current site with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If scheme is 'http' or 'https', is_ssl() is overridden.
In case of WordPress Network setup, use network_admin_url() instead.
<?php admin_url( $path, $scheme ); ?>
<?php $url = admin_url(); ?>
echo admin_url();
Output: http://www.example.com/wp-admin/ (protocol will be https when appropriate)
// generate url path to admin's "Categories", and force https echo admin_url( 'edit-tags.php?taxonomy=category', 'https' );
Output: https://www.example.com/wp-admin/edit-tags.php?taxonomy=category
admin_url()
is located in wp-includes/link-template.php
.
WordPress Directories: | ||
---|---|---|
home_url() | Home URL | http://www.example.com |
site_url() | Site directory URL | http://www.example.com or http://www.example.com/wordpress |
admin_url() | Admin directory URL | http://www.example.com/wp-admin |
includes_url() | Includes directory URL | http://www.example.com/wp-includes |
content_url() | Content directory URL | http://www.example.com/wp-content |
plugins_url() | Plugins directory URL | http://www.example.com/wp-content/plugins |
theme_url() | Themes directory URL (#18302) | http://www.example.com/wp-content/themes |
wp_upload_dir() | Upload directory URL (returns an array) | http://www.example.com/wp-content/uploads |