首页 WordPress函数大全 get_site_url()

get_site_url()

2020-05-01 / 4050阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_site_url( int $blog_id = null, string $path = '', string $scheme = null )

Retrieves the URL for a given site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible.

描述

Returns the ‘site_url’ option with the appropriate protocol, ‘https’ if is_ssl() and ‘http’ otherwise. If $scheme is ‘http’ or ‘https’, is_ssl() is overridden.

参数

$blog_id

(int)
(Optional)
Site ID. Default null (current site).

Default value: null

$path

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

Default value: ''

$scheme

(string)
(Optional)
Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'login_post', 'admin', or 'relative'.

Default value: null

返回

(string) Site URL link with optional path appended.

大家谈论
    我的见解