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
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
jQuery(document).ready(function($) { | |
//default values | |
var thisPrefix = 'gjm'; | |
var thisForm = false; | |
var thisTarget = false; | |
var addressField = false; | |
var prevAddressField = false; | |
var latField = false; | |
var lngField = false; |
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 gjm_radius_dropdown( $output, $radius, $gjm_object ) { | |
$output = ''; | |
$output .= '<div class="'.$gjm_object->prefix.'-filter-wrapper '.$gjm_object->prefix.'-radius-wrapper radius dropdown '.$gjm_object->prefix.'-filters-count-'.esc_attr( $gjm_object->filters['filters_count'] ).'">'; | |
$output .= '<select name="'.$gjm_object->prefix.'_radius" class="'.$gjm_object->prefix.'-filter" id="'.$gjm_object->prefix.'-radius">'; | |
foreach ( $radius as $value ) { | |
$value = esc_attr( $value ); | |
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
<?php | |
function gmw_modify_search_form_taxonomy_args( $args, $taxonomy, $gmw ) { | |
// Limit the fuction to a specific form using it's ID. | |
if ( 1 !== $gmw['ID'] ) { | |
return $args; | |
} | |
// limit the function to a specific taxonmoy. | |
if ( "category" !== $taxonomy->name ) { |
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 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> |
NewerOlder