Contact Info Widget: Add a filter for a Google API Key#4265
Merged
Conversation
Google now requires an API key for all new domains. This add the ability to add one via a filter. Users should enable both the Google Maps JS API and the Google Maps Embed API for their given key for the best long-term performance.
modules/widgets/contact-info.php
Outdated
|
|
||
| wp_enqueue_script( 'jquery' ); | ||
| wp_enqueue_script( 'google-maps', 'https://maps.googleapis.com/maps/api/js?sensor=false' ); | ||
| wp_enqueue_script( 'google-maps', esc_url( $google_url ) ); |
Member
There was a problem hiding this comment.
Should we be escaping this? At very least, I'd check to make sure that encoding the & doesn't break the script import (noticed some issues with this in earlier iterations of changes).
Contributor
Author
There was a problem hiding this comment.
add_query_arg doesn't provide any protection and since it is an user-provided value, we should. But, you're right, I'm using esc_url in the default display context. Changing it to send null context will save the ampersands.
Member
|
This looks good to merge. I'll merge this once the tests pass. |
jeherve
added a commit
that referenced
this pull request
Jul 1, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #4240
The smallest delta to keep functionality up. #4242 is still valid and the home to a more long-term intermediate fix :)