get_home_url() WP 1.0
Retrieves the URL for a given site where the front end is accessible.
Returns the 'home' option with the appropriate protocol. The protocol will be 'https' if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option. If $scheme is 'http' or 'https', is_ssl() is overridden.
Basis of: get_rest_url(), home_url()
1 time = 0.000065s = very fast | 50000 times = 0.39s = very fast | PHP 7.1.2, WP 4.7.3
Hooks from the function
Return
String. Home URL link with optional path appended.
Usage
get_home_url( $blog_id, $path, $scheme );
- $blog_id(int)
- Site ID.
Default: null (current site) - $path(string)
- Path relative to the home URL.
Default: '' - $scheme(string/null)
- Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null.
Default: null
Notes
- Global. String. $pagenow
Changelog
Since 3.0.0 | Introduced. |
Code of get_home_url() get home url WP 5.6
Related Functions
From tag: Link (URL)
- admin_url()
- attachment_url_to_postid()
- build_query()
- comment_link()
- content_url()
- get_comments_link()
- get_comments_pagenum_link()
- get_edit_post_link()
- get_edit_term_link()
- get_next_comments_link()
- get_post_embed_url()
- get_post_permalink()
- get_post_type_archive_link()