admin_url()返回后台管理地址

目录

描述

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.

admin_url() 描述

用法

<?php admin_url$path$scheme ); ?>

Default Usage

<?php $url admin_url(); ?>

admin_url() 用法

参数

$path

(string) (可选) Path relative to the admin url.

默认值: None

$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. The function uses get_site_url(), so allowed values include any accepted by that function.

默认值: 'admin'

admin_url() 参数

示例

Output: http://www.example.com/wp-admin/
(protocol will be https when appropriate)

Output: https://www.example.com/wp-admin/edit-tags.php?taxonomy=category

admin_url() 示例

注意

admin_url() 注意

相关