user_admin_url() - WordPress 函数参考中文文档

返回介绍

user_admin_url()

发布于 2017-09-11 字数2226 浏览 979 评论 0

user_admin_url( string $path = '',  string $scheme = 'admin' )

Retrieves the URL to the admin area for the current user.


描述


参数

$path

(string)
(Optional)
Path relative to the admin URL.

Default value: ”

$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 value: ‘admin’


返回值

(string) Admin URL link with optional path appended.


源代码

File: wp-includes/link-template.php

function user_admin_url( $path = '', $scheme = 'admin' ) {
	$url = network_site_url('wp-admin/user/', $scheme);

	if ( $path && is_string( $path ) )
		$url .= ltrim($path, '/');

	/**
	 * Filters the user admin URL for the current user.
	 *
	 * @since 3.1.0
	 *
	 * @param string $url  The complete URL including scheme and path.
	 * @param string $path Path relative to the URL. Blank string if
	 *                     no path is specified.
	 */
	return apply_filters( 'user_admin_url', $url, $path );
}

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Uses

  • wp-includes/link-template.php:
    network_site_url()
  • wp-includes/link-template.php:
    user_admin_url
  • wp-includes/plugin.php:
    apply_filters()

Used By

  • wp-includes/link-template.php:
    self_admin_url()
  • wp-includes/link-template.php:
    get_dashboard_url()
  • wp-includes/link-template.php:
    get_edit_profile_url()
  • wp-includes/class-wp-admin-bar.php:
    WP_Admin_Bar::initialize()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!