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
| 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 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
| 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 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
| 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 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
| 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 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
| <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 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
| 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 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
| 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 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
| 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 |
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
| 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 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
| // 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'; | |
| } |