mirror of
https://gh.wpcy.net/https://github.com/aspirepress/aspireupdate.git
synced 2026-07-17 09:56:36 +08:00
26 lines
613 B
PHP
26 lines
613 B
PHP
<?php
|
|
/**
|
|
* The Class for Miscellaneous Helper Functions.
|
|
*
|
|
* @package aspire-update
|
|
*/
|
|
|
|
namespace AspireUpdate;
|
|
|
|
/**
|
|
* The Class for Admin Settings Page and functions to access Settings Values.
|
|
*/
|
|
class Utilities {
|
|
|
|
/**
|
|
* Get the top level domain name from the site URL.
|
|
*
|
|
* @return string the top level domain name.
|
|
*/
|
|
public static function get_top_level_domain() {
|
|
$site_url = get_site_url();
|
|
$domain_name = wp_parse_url( $site_url, PHP_URL_HOST );
|
|
$domain_parts = explode( '.', $domain_name );
|
|
return sanitize_text_field( implode( '.', array_slice( $domain_parts, -2 ) ) );
|
|
}
|
|
}
|