函数原型
admin_url( string $path = ”, string $scheme = ‘admin’ ): string
函数描述
Retrieves the URL to the admin area for the current site.
是否弃用
未弃用
函数参数
-
$path
string
Optional - Path relative to the admin URL.
Default:
'' -
$scheme
string
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'
函数返回值
string Admin URL link with optional path appended.
函数位置
File: wp-includes/link-template.php.
函数源码
function admin_url( $path = '', $scheme = 'admin' ) {
return get_admin_url( null, $path, $scheme );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |

