This file contains 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
function gfgeo_disable_adderss_field_autofill() { | |
?> | |
<script type="text/javascript"> | |
jQuery( document ).ready( function( $ ) { | |
jQuery( '.gfgeo-address-field' ).attr( 'autocomplete', 'gfgeo-address-field' ); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'gfgeo_disable_adderss_field_autofill' ); |
This file contains 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
$args = array( | |
'taxonomy' => $taxonomy, // taxonomy slug | |
'orderby' => 'name', | |
'order' => 'ASC, | |
'hide_empty' => 1, | |
'include' => '', | |
'exclude' => '', | |
'exclude_tree' => '', | |
'number' => 0, |
This file contains 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
/* | |
This example integrates GEO my WP and Events Manager plugin. | |
The script will update GEO my WP database table with the location | |
entered in the Event form from the front-end and back-end. | |
Note that when using GEO my WP together with Event Manager plugin | |
you should disable the GMW Location section for the Events Edit Post page ( in the back-end ) | |
since The usage of Google maps API by the to plugin causes a conflict. | |
*/ |
This file contains 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
/* | |
This example can be used with any post type. | |
The update location function is triggered using the | |
save_post_{post-type-name} action which fires every time | |
a new post is created or an existing post is updated. | |
The action hook passes the argument $post_id into the update location function. | |
Assuming that the address entered in the front end form is saved via custom field |
This file contains 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
function gmw_resize_tab_map() { | |
?> | |
<script type="text/javascript"> | |
jQuery( 'document' ).ready( function($) { | |
// on click | |
jQuery( '.test_tab' ).on( 'click', function() { | |
setTimeout(function() { |
This file contains 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
function gfgeo_move_map_marker_onclick() { | |
?> | |
<script> | |
jQuery( document ).on( 'gfgeo_render_map', function( event, GF_Geo, map_data ) { | |
GF_Geo.map_single_click = false; | |
google.maps.event.addListener( GF_Geo.maps[map_data.map_id].map, 'click', function( event) { | |
GF_Geo.map_single_click = true; |
This file contains 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
<!-- directions --> | |
<?php if ( $directions && ! empty( $post->formatted_address ) ) : ?> | |
<div class="gmw-nbp-directions-wrapper"> | |
<i class="fa fa-location-arrow"></i> | |
<a class="gmw-nbl-get-directions gmw-posts-get-directions" href="http://maps.google.com/?q=<?php echo esc_attr( $post->formatted_address ); ?>" target="_blank">Show in Google map</a> | |
</div> |
This file contains 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
// if form ID 1 submitted show results | |
// change the value 1 to the ID of your form | |
if ( !empty( $_GET['action'] ) && $_GET['action'] == 'gmw_post' && !empty( $_GET['gmw_form'] ) && $_GET['gmw_form'] == 1 ) { | |
echo do_shortcode( '[gmw form="results"]' ); | |
// otherwise, show content. | |
} else { | |
echo 'some content'; | |
} |
This file contains 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
function gmw_get_directions_fix( $output, $gmw, $info, $title ) { | |
$title = ! empty( $title ) ? $title : $gmw['labels']['search_results']['directions']; | |
$ulLatLng = ( $gmw['your_lat'] == 'false' || $gmw['your_lng'] == 'false' ) ? '' : "{$gmw['your_lat']},{$gmw['your_lng']}"; | |
$output = '<a class="gmw-get-directions gmw-'.$gmw['prefix'].'-get-directions" | |
title="'.$title.'" | |
href="http://maps.google.com/maps?f=d&hl='.esc_attr( $gmw['language'] ).'®ion='.esc_attr( $gmw['region'] ).'&doflg='.esc_attr( $gmw['units_array']['map_units'] ).'&saddr='.esc_attr( $ulLatLng ).'&daddr='.esc_attr( $info->lat ).','.esc_attr( $info->long ).'&ie=UTF8&z=12" target="_blank">'.esc_attr( $title ).'</a>'; | |
return $output; |
This file contains 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
function gfgeo_set_custom_zoom_level() { | |
?> | |
jQuery( document ).ready( function() { | |
jQuery( document ).bind( 'gfgeo_update_map', function( event, mapObject ) { | |
// set map zoom level to 10 | |
mapObject.map.setZoom( 10 ); | |
// pan map into new position |
NewerOlder