Hi, I am getting an undefined variable error with $page wondering how I can adjust this to account for that?
PHP:
<?php
if (get_field('external-site', $page->ID) == '') {
wp_redirect( get_field('external-site', $page->ID) );
} else {
wp_redirect( home_url().'/page-not-found' );
}
?>