function getwhois($domain, $tld) { $override = apply_filters('pre_getwhois', false, $domain, $tld); if ($override !== false) { return $override; } if (empty($domain)) { $domain = nebula_url_components('sld'); //Default value is current domain } if (empty($tld)) { $tld = nebula_url_components('tld'); //Default value is current domain } require_once get_template_directory() . "/includes/libs/class-whois.php"; $whois = new Whois(); if (!$whois->ValidDomain($domain . '.' . $tld)) { return 'Sorry, "' . $domain . '.' . $tld . '" is not valid or not supported.'; } if ($whois->Lookup($domain . '.' . $tld)) { return $whois->GetData(1); } else { return 'A WHOIS error occurred.'; } }