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_google_address_autocomplete() { | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
//Array of input fields ID. | |
var gacFields = ["gmw-address-1","gmw-address-7"]; | |
$.each( gacFields, function( key, 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_include_google_places_api() { | |
//register google maps api if not already registered | |
if ( !wp_script_is( 'google-maps', 'registered' ) ) { | |
wp_register_script( 'google-maps', ( is_ssl() ? 'https' : 'http' ) . '://maps.googleapis.com/maps/api/js?libraries=places&sensor=false', array( 'jquery' ), false ); | |
} | |
//enqueue google maps api if not already enqueued | |
if ( !wp_script_is( 'google-maps', 'enqueued' ) ) { | |
wp_enqueue_script( 'google-maps' ); |
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
<div class="website"> | |
<i class="">Website: </i> | |
<a href="<?php echo esc_url($post_data->website); ?>" target="_blank"> | |
<?php echo esc_html( $post_data->website ); ?> | |
</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
function gjm_per_category_map_icon( $map_icon, $post ) { | |
// get Job Type terms attached to a job | |
$job_terms = wp_get_post_terms( $post->ID, 'job_listing_type', array( 'fields' => 'ids' ) ); | |
// if term ID is 1 | |
if ( in_array( '1', $job_terms) ) { | |
$map_icon = 'https://maps.google.com/mapfiles/ms/icons/yellow-dot.png'; | |
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
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
var head = document.getElementsByTagName('head')[0]; | |
// Save the original method | |
var insertBefore = head.insertBefore; | |
// Replace it! | |
head.insertBefore = function (newElement, referenceElement) { | |
if (newElement.href && newElement.href.indexOf('http://fonts.googleapis.com/css?family=Roboto') === 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
drag_marker_onclick : function() { | |
google.maps.event.addListener( GF_Geo.map.map, 'click', function( event ){ | |
GF_Geo.map.marker.setPosition( event.latLng ); | |
// save some map details | |
GF_Geo.processing.status = true; | |
GF_Geo.processing.element = 'map'; | |
GF_Geo.processing.coords = { |
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
<?php | |
$args = array( | |
'show_option_all' => '', | |
'show_option_none' => '', | |
'orderby' => 'ID', | |
'order' => 'ASC', | |
'show_count' => 0, | |
'hide_empty' => 1, | |
'child_of' => 0, | |
'exclude' => '', |