get_site_url [ WordPress Function ]
get_site_url ( $blog_id = null, $path = '', $scheme = null )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Source
<?php
function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
// should the list of allowed schemes be maintained elsewhere?
$orig_scheme = $scheme;
if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) {
if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) )
$scheme = 'https';
elseif ( ( 'login' == $scheme ) && force_ssl_admin() )
$scheme = 'https';
elseif ( ( 'admin' == $scheme ) && force_ssl_admin() )
$scheme = 'https';
else
$scheme = ( is_ssl() ? 'https' : 'http' );
}
if ( empty( $blog_id ) || !is_multisite() )
$url = get_option( 'siteurl' );
else
$url = get_blog_option( $blog_id, 'siteurl' );
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( 'site_url', $url, $path, $orig_scheme, $blog_id );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/get site url « WordPress Codex
The get_site_url() template tag retrieves the site url for a given site. Returns the ' siteurl' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise.
codex.wordpress.org - WordPress › Support » how to get admin url? get_site_url?
I have an uploader in my theme that had worked pretty good, however it has a hardcoded path I'd like to work on //If no errors registred, redirect back to the ...
wordpress.org - urls - get_site_url is not returning anything? - WordPress
Mar 13, 2011 ... share [g+] share [fb] share [tw]. I'm using the twentyten theme with the bbpress plugin. I have the following in my header.php (twentyten): ...
wordpress.stackexchange.com - get_site_url (WordPress Function) - WPSeek.com
WordPress lookup for get_site_url, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com
Gebruikersdiscussies [ wordpress.org ]
- David Gwyer on "how to get admin url? get_site_url?"
- Rev. Voodoo on "how to get admin url? get_site_url?"
- David Gwyer on "how to get admin url? get_site_url?"
- Rev. Voodoo on "how to get admin url? get_site_url?"
- David Gwyer on "how to get admin url? get_site_url?"
- Rev. Voodoo on "how to get admin url? get_site_url?"
- David Gwyer on "how to get admin url? get_site_url?"
- Rev. Voodoo on "how to get admin url? get_site_url?"