home_url( string $path = '', string|null $scheme = null )
Retrieves the URL for the current site where the front end is accessible.
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
- $path
-
(Optional) Path relative to the home URL.
Default value: ''
- $scheme
-
(Optional) Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null.
Default value: null
Return
(string) Home URL link with optional path appended.
Source
File: wp-includes/link-template.php
function home_url( $path = '', $scheme = null ) {
return get_home_url( null, $path, $scheme );
}
Related
Uses
Uses | Description |
---|---|
wp-includes/link-template.php: get_home_url() |
Retrieves the URL for a given site where the front end is accessible. |
Used By
Used By | Description |
---|---|
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_plugin_theme_email() |
Sends an email upon the completion or failure of a plugin or theme background update. |
wp-admin/includes/class-wp-site-health.php: WP_Site_Health::check_for_page_caching() |
Checks if site has page cache enabled or not. |
wp-admin/includes/ajax-actions.php: wp_ajax_quick_edit_attachment() |
Ajax handler for updating attachment values and attributes. |
wp-includes/class-wp-recovery-mode-email-service.php: WP_Recovery_Mode_Email_Service::send_recovery_mode_email() |
Sends the Recovery Mode email to the site admin email address. |
wp-includes/https-detection.php: wp_is_home_url_using_https() |
Checks whether the current site URL is using HTTPS. |
wp-includes/https-detection.php: wp_update_https_detection_errors() |
Runs a remote HTTPS request to detect whether HTTPS supported, and stores potential errors. |
wp-includes/class-wp-recovery-mode.php: WP_Recovery_Mode::handle_exit_recovery_mode() |
Handles a request to exit Recovery Mode. |
wp-includes/feed.php: get_self_link() |
Returns the link for the currently displayed feed. |
wp-includes/sitemaps/class-wp-sitemaps-provider.php: WP_Sitemaps_Provider::get_sitemap_url() |
Gets the URL of a sitemap entry. |
wp-includes/sitemaps/class-wp-sitemaps-index.php: WP_Sitemaps_Index::get_index_url() |
Builds the URL for the sitemap index. |
wp-includes/sitemaps/class-wp-sitemaps-renderer.php: WP_Sitemaps_Renderer::get_sitemap_stylesheet_url() |
Gets the URL for the sitemap stylesheet. |
wp-includes/sitemaps/class-wp-sitemaps-renderer.php: WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url() |
Gets the URL for the sitemap index stylesheet. |
wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php: WP_Sitemaps_Posts::get_url_list() |
Gets a URL list for a post type sitemap. |
wp-includes/link-template.php: wp_internal_hosts() |
Returns an array of URL hosts which are considered to be internal hosts. |
wp-includes/https-migration.php: wp_should_replace_insecure_home_url() |
Checks whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart. |
wp-includes/https-migration.php: wp_replace_insecure_home_url() |
Replaces insecure HTTP URLs to the site in the given content, if configured to do so. |
wp-signup.php: confirm_another_blog_signup() |
Shows a message confirming that the new site has been created. |
wp-includes/author-template.php: get_author_posts_url() |
Retrieves the URL to the author page for the user with the ID provided. |
wp-login.php: login_footer() |
Outputs the footer for the login page. |
wp-includes/deprecated.php: wp_admin_bar_dashboard_view_site_menu() |
Add the “Dashboard”/”Visit Site” menu. |
wp-includes/general-template.php: get_login_image_html() |
Return the HTML for the image on the login screen. This is either a link showing the ClassicPress logo (the default) or the site’s custom login image (if enabled). |
wp-includes/general-template.php: wp_get_archives() |
Displays archive links based on type and format. |
wp-includes/general-template.php: get_bloginfo() |
Retrieves information about the current site. |
wp-includes/general-template.php: get_custom_logo() |
Returns a custom logo, linked to home unless the theme supports removing the link on the home page. |
wp-includes/general-template.php: get_search_form() |
Displays search form. |
wp-includes/rest-api/class-wp-rest-server.php: WP_REST_Server::get_index() |
Retrieves the site index. |
wp-includes/widgets/class-wp-widget-rss.php: WP_Widget_RSS::widget() |
Outputs the content for the current RSS widget instance. |
wp-includes/widgets/class-wp-widget-categories.php: WP_Widget_Categories::widget() |
Outputs the content for the current Categories widget instance. |
wp-includes/pluggable.php: wp_validate_redirect() |
Validates a URL for use in a redirect. |
wp-includes/comment.php: weblog_ping() |
Sends a pingback. |
wp-includes/comment.php: wp_set_comment_cookies() |
Sets the cookies used to store an unauthenticated commentator’s identity. Typically used to recall previous comments by this commentator that are still held in moderation. |
wp-includes/nav-menu-template.php: _wp_menu_item_classes_by_context() |
Adds the class property classes for the current context, if applicable. |
wp-includes/admin-bar.php: wp_admin_bar_search_menu() |
Adds search form. |
wp-includes/admin-bar.php: wp_admin_bar_site_menu() |
Adds the “Site Name” menu. |
wp-includes/admin-bar.php: wp_admin_bar_my_sites_menu() |
Adds the “My Sites/[Site Name]” menu and all submenus. |
wp-includes/embed.php: the_embed_site_title() |
Prints the necessary markup for the site title in an embed template. |
wp-includes/embed.php: get_post_embed_url() |
Retrieves the URL to embed a specific post in an iframe. |
wp-includes/class-wp-admin-bar.php: WP_Admin_Bar::initialize() |
Initializes the admin bar. |
wp-includes/link-template.php: wp_get_shortlink() |
Returns a shortlink for a post, page, attachment, or site. |
wp-includes/link-template.php: network_home_url() |
Retrieves the home URL for the current network. |
wp-includes/link-template.php: get_pagenum_link() |
Retrieves the link for a page number. |
wp-includes/link-template.php: get_search_link() |
Retrieves the permalink for a search. |
wp-includes/link-template.php: get_post_type_archive_link() |
Retrieves the permalink for a post type archive. |
wp-includes/link-template.php: get_month_link() |
Retrieves the permalink for the month archives with year. |
wp-includes/link-template.php: get_day_link() |
Retrieves the permalink for the day archives with year and month. |
wp-includes/link-template.php: get_feed_link() |
Retrieves the permalink for the feed type. |
wp-includes/link-template.php: get_post_comments_feed_link() |
Retrieves the permalink for the post comments feed. |
wp-includes/link-template.php: get_author_feed_link() |
Retrieves the feed link for a given author. |
wp-includes/link-template.php: get_term_feed_link() |
Retrieves the feed link for a term. |
wp-includes/link-template.php: get_permalink() |
Retrieves the full permalink for the current post or post ID. |
wp-includes/link-template.php: get_post_permalink() |
Retrieves the permalink for a post of a custom post type. |
wp-includes/link-template.php: get_page_link() |
Retrieves the permalink for the current page or page ID. |
wp-includes/link-template.php: _get_page_link() |
Retrieves the page permalink. |
wp-includes/link-template.php: get_attachment_link() |
Retrieves the permalink for an attachment. |
wp-includes/link-template.php: get_year_link() |
Retrieves the permalink for the year archives. |
wp-includes/http.php: classicpress_user_agent() |
Returns the ClassicPress User-Agent header for outgoing requests. |
wp-includes/http.php: get_allowed_http_origins() |
Retrieve list of allowed HTTP origins. |
wp-includes/user.php: _wp_privacy_send_request_confirmation_notification() |
Notifies the site administrator via email when a request is confirmed. |
wp-includes/user.php: _wp_privacy_send_erasure_fulfillment_notification() |
Notifies the user when their erasure request is fulfilled. |
wp-includes/user.php: wp_send_user_request() |
Send a confirmation request email to confirm an action. |
wp-includes/user.php: send_confirmation_on_profile_email() |
Sends a confirmation request email when a change of user email address is attempted. |
wp-includes/user.php: wp_update_user() |
Updates a user in the database. |
wp-includes/theme.php: _wp_customize_loader_settings() |
Adds settings for the customize-loader script. |
wp-includes/theme.php: wp_customize_support_script() |
Prints a script to check whether or not the Customizer is supported, and apply either the no-customize-support or customize-support class to the body. |
wp-includes/theme.php: get_theme_starter_content() |
Expands a theme’s starter content configuration using core-provided data. |
wp-includes/class-wp-xmlrpc-server.php: wp_xmlrpc_server::wp_getUsersBlogs() |
Retrieves the blogs of the user. |
wp-includes/category-template.php: wp_list_categories() |
Displays or retrieves the HTML list of categories. |
wp-includes/rewrite.php: url_to_postid() |
Examines a URL and try to determine the post ID it represents. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::set_preview_url() |
Sets the initial URL to be previewed. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::get_preview_url() |
Gets the initial URL to be previewed. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::is_cross_domain() |
Determines whether the admin and the frontend are on different domains. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::get_allowed_urls() |
Gets URLs allowed to be previewed. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::get_return_url() |
Gets URL to link the user to when closing the Customizer. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::customize_pane_settings() |
Prints JavaScript settings for parent window. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::customize_preview_settings() |
Prints JavaScript settings for preview frame. |
wp-includes/post-template.php: wp_page_menu() |
Displays or retrieves a list of pages with an optional home link. |
wp-includes/class-wp-rewrite.php: WP_Rewrite::rewrite_rules() |
Constructs rewrite matches and queries from permalink structure. |
wp-includes/class-wp-rewrite.php: WP_Rewrite::mod_rewrite_rules() |
Retrieves mod_rewrite-formatted rewrite rules to write to .htaccess. |
wp-includes/class-wp-rewrite.php: WP_Rewrite::iis7_url_rewrite_rules() |
Retrieves IIS7 URL Rewrite formatted rewrite rules to write to web.config file. |
wp-includes/canonical.php: wp_redirect_admin_locations() |
Redirects a variety of shorthand URLs to the admin. |
wp-includes/canonical.php: redirect_canonical() |
Redirects incoming links to the proper URL based on the site url. |
wp-includes/post.php: is_local_attachment() |
Determines whether an attachment URI is local and really an attachment. |
wp-includes/class-wp.php: WP::parse_request() |
Parses the request to find the correct WordPress query. |
wp-includes/class-wp-customize-nav-menus.php: WP_Customize_Nav_Menus::load_available_items_query() |
Performs the post_type and taxonomy queries for loading available menu items. |
wp-includes/class-wp-customize-nav-menus.php: WP_Customize_Nav_Menus::search_available_items_query() |
Performs post queries for available-item searching. |
wp-includes/ms-functions.php: wp_network_admin_email_change_notification() |
Sends an email to the old network admin email address when the network admin email address changes. |
wp-includes/ms-functions.php: maybe_add_existing_user_to_blog() |
Adds a new user to a blog by visiting /newbloguser/{key}/. |
wp-includes/update.php: wp_version_check() |
Checks WordPress version against the newest version. |
wp-includes/taxonomy.php: get_term_link() |
Generates a permalink for a taxonomy term archive. |
wp-includes/class-wp-oembed.php: WP_oEmbed::__construct() |
Constructor. |
wp-includes/functions.php: wp_site_admin_email_change_notification() |
Sends an email to the old site admin email address when the site admin email address changes. |
wp-includes/functions.php: wp_get_referer() |
Retrieves referer from ‘_wp_http_referer’ or HTTP referer. |
wp-admin/includes/class-custom-background.php: Custom_Background::admin_page() |
Displays the custom background page. |
wp-admin/includes/class-custom-image-header.php: Custom_Image_Header::step_1() |
Display first step of custom header image page. |
wp-admin/includes/misc.php: update_option_new_admin_email() |
Sends a confirmation request email when a change of site admin email address is attempted. |
wp-admin/includes/nav-menu.php: wp_nav_menu_item_post_type_meta_box() |
Displays a meta box for a post type menu item. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_email() |
Sends an email upon the completion or failure of a background core update. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_debug_email() |
Prepares and sends an email of a full log of background update results, useful for debugging and geekery. |
wp-admin/includes/user.php: admin_created_user_email() | |
wp-admin/includes/privacy-tools.php: wp_privacy_send_personal_data_export_email() |
Send an email to the user with a link to the personal data export file |
wp-admin/includes/file.php: wp_edit_theme_plugin_file() |
Attempts to edit a file for a theme or plugin. |
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |