public function geocode_api_orig( $args ) {
$defaults = array(
'region' => 'US',
'language' => 'en',
);
$options = wp_parse_args( $this->options, $defaults );
$defaults = array(
'sensor' => 'false',
'region' => $options['region'],
'language' => $options['language'],
);
$args = wp_parse_args($args, $defaults);
$response = wp_remote_get( add_query_arg( $args, $this->api_url ) );
if ( 200 != wp_remote_retrieve_response_code( $response ) )
return false;
$this->geocode_results = json_decode( wp_remote_retrieve_body( $response ), true );
if ( !$this->geocode_results || 'OK' != $this->geocode_results['status'] )
return false;
$this->process_geocode();
}
public function geocode_api_orig( $args ) {
$defaults = array(
'geo_region' => 'US',
'geo_language' => 'en',
);
$options = wp_parse_args( $this->options, $defaults );
$defaults = array(
'sensor' => 'false',
'region' => $options['geo_region'],
'language' => $options['geo_language'],
);
$args = wp_parse_args($args, $defaults);
$response = wp_remote_get( add_query_arg( $args, $this->api_url ) );
if ( 200 != wp_remote_retrieve_response_code( $response ) )
return false;
$this->geocode_results = json_decode( wp_remote_retrieve_body( $response ), true );
if ( !$this->geocode_results || 'OK' != $this->geocode_results['status'] )
return false;
$this->process_geocode();
}
There are currently 1 users browsing this thread. (0 members and 1 guests)