Last active
November 2, 2018 16:38
-
-
Save BoweFrankema/d33564efda0c8ca9705e567c6deb8b94 to your computer and use it in GitHub Desktop.
ACF FB Redirect
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 | |
//Redirect on special URL format. ie: https://examplesite.com/?profile=visit | |
function fb_acf_profile_redirect() | |
{ | |
$profile = $_GET['profile']; | |
//Is the profile link being requested | |
if ( $profile == 'visit' ) { | |
wp_safe_redirect( get_field('profile_redirect', 'option') ); | |
exit; | |
} | |
} | |
add_action('template_redirect', 'fb_acf_profile_redirect'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment