Created
October 10, 2017 13:20
-
-
Save turtlepod/e396d9708d0454715101ea9a0038d95d to your computer and use it in GitHub Desktop.
listify_custom_autolocation *better
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 | |
/** | |
* Auto Populate Location Field | |
* | |
* @link https://www.facebook.com/groups/1035604846471813/permalink/1656529524379339/ | |
*/ | |
function listify_custom_autolocation() { | |
if ( ! ( is_front_page() || listify_is_job_manager_archive() ) ) { | |
return; | |
} | |
if ( isset( $_GET['search_location'] ) ) { | |
return; | |
} | |
?> | |
<script> | |
jQuery(document).ready(function() { | |
var locate = jQuery( '.locate-me' ); | |
locate.trigger( 'click' ); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'listify_custom_autolocation', 9999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment