site_url() WP 1.0
Retrieves the URL for the current 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.
Works based on: get_site_url()
Basis of: wp_registration_url()
1 time = 0.00026s = fast | 50000 times = 7.44s = fast
No Hooks.
Return
String. Site URL link with optional path appended.
Usage
site_url( $path, $scheme );
- $path(string)
- Path relative to the site URL.
Default: '' - $scheme(string)
- Scheme to give the site URL context. See set_url_scheme().
Default: null
Changelog
Since 3.0.0 | Introduced. |
Code of site_url() site url WP 5.6
function site_url( $path = '', $scheme = null ) {
return get_site_url( null, $path, $scheme );
}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_home_url()
- get_next_comments_link()
- get_post_embed_url()
- get_post_permalink()