Created
September 22, 2016 17:54
-
-
Save timersys/4565da1a2bc7f958e4e3ada093f0a469 to your computer and use it in GitHub Desktop.
Change geotargeting hook to be able to use template functions
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
| <?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