Changeset 2072655
- Timestamp:
- 04/22/2019 03:30:26 PM (7 years ago)
- Location:
- embed-gutenberg-block-google-maps/trunk
- Files:
-
- 2 edited
-
embed-gutenberg-block-google-maps.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
embed-gutenberg-block-google-maps/trunk/embed-gutenberg-block-google-maps.php
r2054291 r2072655 5 5 * Author: Pantheon, Andrew Taylor 6 6 * Author URI: https://pantheon.io/ 7 * Version: 1.5. 27 * Version: 1.5.3 8 8 * License: MIT 9 9 * License URI: https://opensource.org/licenses/MIT … … 128 128 $apiURL = ( $interactive ) ? "https://www.google.com/maps/embed/v1/place?key=${APIkey}&q=${location}&zoom=${zoom}&maptype=${mapType}" : "https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=${maxWidth}x${maxHeight}&maptype=${mapType}&key=${APIkey}"; 129 129 130 // Look for a cached response code for the map URL.131 $httpcode = get_transient( 'pantheon_google_map_block_url_response_code' );132 133 // Ensure the status code from cache is an integer.134 if( false !== $httpcode ) {135 $httpcode = intval( $httpcode );136 }137 138 // If the response code is not found in the cache139 // Or the current response code is not a 200140 if( false === $httpcode || $httpcode !== 200 ) {141 // Get a new response code for the map URL142 $response = wp_remote_head( $apiURL );143 $httpcode = wp_remote_retrieve_response_code( $response );144 // Set a transient to cache the response code.145 set_transient( 'pantheon_google_map_block_url_response_code', $httpcode, DAY_IN_SECONDS );146 }147 148 // Don't output anything if the response from Google Maps isn't a 200.149 if( $httpcode !== 200 ){150 return;151 }152 153 130 // Set the appropriate CSS class names 154 131 $classNames = ( $interactive ) ? "wp-block-pantheon-google-map interactive ratio$aspectRatio" : "wp-block-pantheon-google-map"; -
embed-gutenberg-block-google-maps/trunk/readme.txt
r2054291 r2072655 7 7 Tested up to: 5.1.1 8 8 Requires PHP: 5.6 9 Stable tag: 1.5. 29 Stable tag: 1.5.3 10 10 License: MIT 11 11 License URI: https://opensource.org/licenses/MIT … … 67 67 68 68 == Changelog == 69 70 = 1.5.3 = 71 Remove the server-side check for a valid Google Maps URL as it was failing and preventing the map from rendering in some environments. If an invalid Google Maps API key is provided, an error message from Google Maps will be rendered on the page. 69 72 70 73 = 1.5.2 =
Note: See TracChangeset
for help on using the changeset viewer.