Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Last active November 2, 2018 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoweFrankema/d33564efda0c8ca9705e567c6deb8b94 to your computer and use it in GitHub Desktop.
Save BoweFrankema/d33564efda0c8ca9705e567c6deb8b94 to your computer and use it in GitHub Desktop.
ACF FB Redirect
<?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