advanced driving course reduce insurance
Tuesday, January 15, 2019

advanced driving course reduce insurance

WordPress.org

  • Showcase
  • Themes
  • Plugins
  • Mobile
  • Support
    • Forums
    • Documentation
  • Get Involved
  • About
  • Blog
  • Hosting
  • Get WordPress

Code Reference

Skip to content

Search

Browse:
Home /
Reference /
Functions / get_home_url()

get_home_url( int $blog_id = null, string $path = , string|null $scheme = null )

Retrieves the URL for a given site where the front end is accessible.

Contents

  • Description
    • Parameters
    • Return
    • Source
    • Changelog
  • More Information
  • Related
    • Uses
    • Used By
  • User Contributed Notes

Description Description

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.


Parameters Parameters

$blog_id

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

Default value: null

$path

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

Default value: ”

$scheme

(string|null)
(Optional)
Scheme to give the home URL context. Accepts ‘http’, ‘https’, ‘relative’, ‘rest’, or null.

Default value: null


Top ↑

Return Return

(string) Home URL link with optional path appended.


Top ↑

Source Source

File: wp-includes/link-template.php

function get_home_url( $blog_id = null, $path = '', $scheme = null ) !is_multisite() )	$url = get_option( 'home' ); else	switch_to_blog( $blog_id );	$url = get_option( 'home' );	restore_current_blog();	if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) )	if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow )	$scheme = 'https';	else	$scheme = parse_url( $url, PHP_URL_SCHEME );	$url = set_url_scheme( $url, $scheme );	if ( $path && is_string( $path ) )	$url .= '/' . ltrim( $path, '/' );	return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );


Expand full source code
Collapse full source code

View on Trac


Top ↑

Changelog Changelog

Changelog
VersionDescription
3.0.0 Introduced.

Top ↑

More Information More Information

Basic Usage

<?php echo get_home_url(); ?>

Will output: https://www.example.com With the domain and the schema matching your settings.


Top ↑

Related Related

Top ↑

Uses Uses

Uses
UsesDescription
wp-includes/load.php:
is_multisite()

If Multisite is enabled.

wp-includes/load.php:
is_admin()

Determines whether the current request is for an administrative interface page.

wp-includes/load.php:
is_ssl()

Determines if SSL is used.

wp-includes/link-template.php:
set_url_scheme()

Sets the scheme for a URL.

wp-includes/link-template.php:
home_url

Filters the home URL.

wp-includes/plugin.php:
apply_filters()

Call the functions added to a filter hook.

wp-includes/option.php:
get_option()

Retrieves an option value based on an option name.

wp-includes/ms-blogs.php:
switch_to_blog()

Switch the current blog.

wp-includes/ms-blogs.php:
restore_current_blog()

Restore the current blog, after calling switch_to_blog()

Show 4 more uses
Hide more uses


Top ↑

Used By Used By

Used By
Used ByDescription
wp-includes/rest-api.php:
get_rest_url()

Retrieves the URL to a REST endpoint on a site.

wp-includes/embed.php:
get_oembed_response_data()

Retrieves the oEmbed response data for a given post.

wp-admin/includes/class-wp-ms-sites-list-table.php:
WP_MS_Sites_List_Table::handle_row_actions()

Generates and displays row action links.

wp-admin/includes/class-wp-ms-users-list-table.php:
WP_MS_Users_List_Table::column_blogs()

Handles the sites column output.

wp-signup.php:
signup_another_blog()

Allow returning users to sign up for another site

wp-admin/includes/ms.php:
_access_denied_splash()

Displays an access denied message when a user tries to view a site’s dashboard they do not have access to.

wp-admin/includes/ms.php:
choose_primary_blog()

Handles the display of choosing a user’s primary site.

wp-admin/includes/ms.php:
confirm_delete_users()
wp-admin/includes/options.php:
options_general_add_js()

Display JavaScript on the page.

wp-includes/link-template.php:
home_url()

Retrieves the URL for the current site where the front end is accessible.

wp-includes/link-template.php:
get_post_type_archive_link()

Retrieves the permalink for a post type archive.

wp-includes/class-wp-admin-bar.php:
WP_Admin_Bar::initialize()
wp-includes/admin-bar.php:
wp_admin_bar_site_menu()

Add the “Site Name” menu.

wp-includes/admin-bar.php:
wp_admin_bar_my_sites_menu()

Add the “My Sites/[Site Name]” menu and all submenus.

wp-includes/ms-functions.php:
install_blog()

Install an empty blog.

Show 10 more used by
Hide more used by


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.

Code is Poetry.

Skip to toolbar