WordPress函数文档admin_url()

返回后台管理地址 描述 The admin_url template tag retrieves the ur…

返回后台管理地址

描述

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 ); ?>

Default Usage

<?php $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’

示例

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

注意

  • 使用到 get_admin_url()

相关

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
  • 原文:http://codex.wordpress.org/Function_Reference/admin_url
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT