| 1 |
<?php |
| 2 |
|
| 3 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 4 |
namespace Yoast\WP\SEO\Schema_Aggregator\Infrastructure; |
| 5 |
|
| 6 |
use Yoast\WP\SEO\Schema_Aggregator\Domain\Current_Site_URL_Provider_Interface; |
| 7 |
|
| 8 |
/** |
| 9 |
* WordPress implementation of current site URL provider. |
| 10 |
*/ |
| 11 |
class WordPress_Current_Site_URL_Provider implements Current_Site_URL_Provider_Interface { |
| 12 |
|
| 13 |
/** |
| 14 |
* Gets the current site's home URL with trailing slash. |
| 15 |
* |
| 16 |
* @return string The current site's home URL. |
| 17 |
*/ |
| 18 |
public function get_current_site_url(): string { |
| 19 |
$blog_id = \get_current_blog_id(); |
| 20 |
return \trailingslashit( \get_home_url( $blog_id ) ); |
| 21 |
} |
| 22 |
} |
| 23 |
|