WPSEO_Sitemaps_Router::get_base_url()public staticYoast 1.0

Create base URL for the sitemap.

Метод класса: WPSEO_Sitemaps_Router{}

Хуки из метода

Возвращает

Строку. base URL (incl page)

Использование

$result = WPSEO_Sitemaps_Router::get_base_url( $page );
$page(строка) (обязательный)
Page to append to the base URL.

Код WPSEO_Sitemaps_Router::get_base_url() Yoast 25.0

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 ) );
}