user_admin_url

函式
user_admin_url ( $path = '', $scheme = 'admin' )
引數
  • (string) $path Optional. Path relative to the admin URL. Default empty.
    Required:
    Default: (empty)
  • (string) $scheme 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.
    Required:
    Default: 'admin'
返回值
  • (string) Admin URL link with optional path appended.
定義位置
相關方法
self_admin_urlget_admin_urladmin_urlnetwork_admin_urlis_user_admin
引入
3.0.0
棄用
-

user_admin_url: 這個函式生成使用者管理頁面的URL。

檢索到當前使用者的管理區的URL。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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
* @since 5.8.0 The `$scheme` parameter was added.
*
* @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.
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
* 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
*/
return apply_filters( 'user_admin_url', $url, $path, $scheme );
}
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 * @since 5.8.0 The `$scheme` parameter was added. * * @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. * @param string|null $scheme The scheme to use. Accepts 'http', 'https', * 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). */ return apply_filters( 'user_admin_url', $url, $path, $scheme ); }
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
	 * @since 5.8.0 The `$scheme` parameter was added.
	 *
	 * @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.
	 * @param string|null $scheme The scheme to use. Accepts 'http', 'https',
	 *                            'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
	 */
	return apply_filters( 'user_admin_url', $url, $path, $scheme );
}

常見問題

FAQs
檢視更多 >