• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WPSEO_Sitemaps_Router::get_base_url() – Create base URL for the sitemap.

You appear to be a bot. Output may be restricted

Description

Create base URL for the sitemap.

Usage

$string = WPSEO_Sitemaps_Router::get_base_url( $page );

Parameters

$page
( string ) required – Page to append to the base URL.

Returns

string base URL (incl page)

Source

File name: wordpress-seo/inc/sitemaps/class-sitemaps-router.php
Lines:

1 to 19 of 19
  public static function get_base_url( $page ) {

    global $wp_rewrite;

    $base = $wp_rewrite->using_index_permalinks() ? 'index.php/' : '/';

    
/**
 * Filter the base URL of the sitemaps.
 *
 * @param string $base The string that should be added to home_url() to make the full base URL.
 */
    $base = apply_filters( 'wpseo_sitemaps_base_url', $base );

    /*
		 * Get the scheme from the configured home URL instead of letting WordPress
		 * determine the scheme based on the requested URI.
		 */
    return home_url( $base . $page, wp_parse_url( get_option( 'home' ), PHP_URL_SCHEME ) );
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 27th November 2019

Primary Sidebar

Information

Function name: WPSEO_Sitemaps_Router::get_base_url
Class ref: WPSEO_Sitemaps_Router
Plugin ref: Yoast SEO
Version: 15.4
Sourcefile: inc/sitemaps/class-sitemaps-router.php
File ref: inc/sitemaps/class-sitemaps-router.php
Deprecated?: No
API Letters: B,G,R,S,W

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites