Retrieve the url to the admin area for a given site.
Signature
get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' )
- blog_id
- (int) (optional) Blog ID. Defaults to current blog.
Default:null - path
- (string) Optional path relative to the admin url.
Default:'' - scheme
- (string) 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
function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
$url = get_site_url($blog_id, 'wp-admin/', $scheme);
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
$url .= ltrim( $path, '/' );
return apply_filters( 'admin_url', $url, $path, $blog_id );
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/get_admin_url/ -
HTML
<a href='http://queryposts.com/function/get_admin_url/'>get_admin_url()</a> -
Markdown
[get_admin_url()](http://queryposts.com/function/get_admin_url/) -
BBCode
[url=http://queryposts.com/function/get_admin_url/]get_admin_url()[/url]