get_home_url [ WordPress Function ]
get_home_url ( $blog_id = null, $path = '', $scheme = null )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Source
<?php
function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
$orig_scheme = $scheme;
if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
$scheme = is_ssl() && !is_admin() ? 'https' : 'http';
if ( empty( $blog_id ) || !is_multisite() )
$url = get_option( 'home' );
else
$url = get_blog_option( $blog_id, 'home' );
if ( 'relative' == $scheme )
$url = preg_replace( '#^.+://[^/]*#', '', $url );
elseif ( 'http' != $scheme )
$url = str_replace( 'http://', "$scheme://", $url );
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
$url .= '/' . ltrim( $path, '/' );
return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/get home url « WordPress Codex
The get_home_url template tag retrieves the home url for a given site. Returns the 'home' option with the appropriate protocol, 'https' if is_ssl() and 'http' ...
codex.wordpress.org - get_home_url (WordPress Function) - WPSeek.com
WordPress lookup for get_home_url, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - wordpress - get_home_url() just returns current URL - Stack Overflow
My problem is simple, I need a "home" link for my WP template, and ... Have you tried: echo get_bloginfo('url') ... It's just home_url(). So: ...
stackoverflow.com - get_home_url | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_home_url( $blog_id = null, $path = '', $scheme = null ) {}. Retrieve the home url for a given site. Returns the 'home' option with the ...
hitchhackerguide.com