home_url()

最后更新于:2021-11-27 05:40:16

home_url( string$path=”, string|null$scheme=null)

Retrieves the URL for the current site where the front end is accessible.

参数

$path

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

Default value: ”

$scheme

(string|null) (Optional) Scheme to give the home URL context. Accepts ‘http’, ‘https’, ‘relative’, ‘rest’, or null.

Default value: null

响应

(string) Home URL link with optional path appended.

源文件

文件: gc-includes/link-template.php

function home_url( $path = '', $scheme = null ) {
	return get_home_url( null, $path, $scheme );
}