Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use 'SypexGeoReader' instead.

MP_Websites::get_address_by_sxgeo()

Get address data for address metabox.


Description Description

See also See also


Top ↑

Return Return

(array) Address data.

  • ''city''
    (string) City
  • ''state''
    (string) State
  • ''country''
    (string) Country
  • ''zipcode''
    (string) Zip Code


Top ↑

Source Source

File: mortgage-platform/Inc/MP_Websites.php

    private function get_address_by_sxgeo()
    {
        $SxGeo = new Reader(plugin_dir_path(__FILE__) . '../vendor/kipkaev55/sxgeo/SxGeoCity.dat');

        $ip      = $this->get_ip();
        $address = array(
            'city'    => $SxGeo->getGeo($ip)['city']['en'] ?? '',
            'state'   => $SxGeo->getGeo($ip)['region']['en'] ?? '',
            'country' => $SxGeo->getGeo($ip)['country']['en'] ?? '',
            'zipcode' => '',
        );

        return $address;
    }

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.