Yoast\WP\SEO\Schema_Aggregator\Infrastructure

WordPress_Current_Site_URL_Provider{}Yoast 1.0└─ Current_Site_URL_Provider_Interface

WordPress implementation of current site URL provider.

Хуков нет.

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

$WordPress_Current_Site_URL_Provider = new WordPress_Current_Site_URL_Provider();
// use class methods

Методы

  1. public get_current_site_url()

Код WordPress_Current_Site_URL_Provider{} Yoast 27.7

class WordPress_Current_Site_URL_Provider implements Current_Site_URL_Provider_Interface {

	/**
	 * Gets the current site's home URL with trailing slash.
	 *
	 * @return string The current site's home URL.
	 */
	public function get_current_site_url(): string {
		$blog_id = \get_current_blog_id();
		return \trailingslashit( \get_home_url( $blog_id ) );
	}
}