Skip to content

Commit 4f73c2b

Browse files
authored
gpaa-show-address-in-language.php: Added snippet to return autocomplete results in a specific language rather than the visitor's language.
1 parent 0e3e61f commit 4f73c2b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Gravity Perks // GP Address Autocomplete // Show Address in a Specific Language
4+
* https://gravitywiz.com/documentation/gravity-forms-address-autocomplete
5+
*
6+
* Instructions:
7+
* 1. Install snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
8+
* 2. Update $language with the ISO 639 two-letter lowercase abbreviation of the desired language e.g. 'en' for English (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
9+
*/
10+
add_filter( 'script_loader_src', function( $src, $handle ) {
11+
if ( 'gp-address-autocomplete-google' !== $handle ) {
12+
return $src;
13+
}
14+
15+
$language = '';
16+
17+
return add_query_arg( 'language', $language, $src );
18+
}, 10, 2 );

0 commit comments

Comments
 (0)