Ejemplo n.º 1
0
 public static function query($ip)
 {
     $response = aam_Core_API::cURL('http://freegeoip.net/xml/' . $ip, false, true);
     if ($response['status'] == 'success') {
         $data = simplexml_load_string($response['content']);
         $geodata = (object) array('countryCode' => (string) $data->CountryCode, 'countryName' => (string) $data->CountryName, 'region' => (string) $data->RegionCode, 'city' => (string) $data->City, 'zip' => (string) $data->ZipCode);
     } else {
         $geodata = null;
     }
     return $geodata;
 }
Ejemplo n.º 2
0
 /**
  *
  * @global type $wp_post_types
  * @return type
  */
 public function retrieveList()
 {
     global $wp_post_types;
     if (aam_Core_Request::post('refresh') == 1) {
         aam_Core_API::deleteBlogOption('aam_metabox_cache');
         $type_list = array_keys($wp_post_types);
         array_unshift($type_list, self::GROUP_WIDGETS);
         foreach ($type_list as $type) {
             if ($type == 'widgets') {
                 $url = add_query_arg('aam_meta_init', 1, admin_url('index.php'));
             } else {
                 $url = add_query_arg('aam_meta_init', 1, admin_url('post-new.php?post_type=' . $type));
             }
             //grab metaboxes
             aam_Core_API::cURL($url);
         }
     }
     return $this->buildMetaboxList();
 }