Skip to content

Instantly share code, notes, and snippets.

@timersys
Created September 22, 2016 17:54
Show Gist options
  • Select an option

  • Save timersys/4565da1a2bc7f958e4e3ada093f0a469 to your computer and use it in GitHub Desktop.

Select an option

Save timersys/4565da1a2bc7f958e4e3ada093f0a469 to your computer and use it in GitHub Desktop.
Change geotargeting hook to be able to use template functions
<?php
/**
* Change geotargeting hook to be able to use template functions
* */
add_action('init', 'change_geot_hook',5);
function change_geot_hook(){
global $geot;
remove_action( 'init', array( $geot->public, 'geot_redirections' ));
add_action( 'template_redirect', array( $geot->public, 'geot_redirections' ));
}
add_filter( 'geot/perform_redirect', 'bypass_redirection');
function bypass_redirection() {
if( is_page('contact') )
return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment