@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | function geocode( $address ) { |
45 | 45 | |
46 | - $location = new \WP_Error(100, 'No results found', array( 'address' => $address ) ); |
|
46 | + $location = new \WP_Error( 100, 'No results found', array( 'address' => $address ) ); |
|
47 | 47 | $url = $this->_make_url( $address ); |
48 | 48 | |
49 | 49 | $response = $this->_make_request( $url ); |
50 | 50 | |
51 | - if ( ! is_wp_error( $response ) && count( $response['results'] ) > 0 ) { |
|
51 | + if ( !is_wp_error( $response ) && count( $response['results'] ) > 0 ) { |
|
52 | 52 | $location = $this->_make_location( $response['results'][0] ); |
53 | 53 | } |
54 | 54 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $result_value = ''; |
125 | 125 | |
126 | - if ( isset( $results['address_components'] ) ) { |
|
126 | + if ( isset($results['address_components']) ) { |
|
127 | 127 | foreach ( $results['address_components'] as $component ) { |
128 | 128 | if ( $component['types'][0] === $value ) { |
129 | 129 | $result_value = $component['short_name']; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $cache_key = md5( serialize( $url ) ); |
169 | 169 | |
170 | - if ( ! $data = wp_cache_get( $cache_key ) ) { |
|
170 | + if ( !$data = wp_cache_get( $cache_key ) ) { |
|
171 | 171 | $data = wp_remote_get( $url ); |
172 | 172 | wp_cache_add( $cache_key, $data, 300 ); |
173 | 173 | } |