wp redirect – Does wp_safe_redirect() no longer works?
I used wp_safe_redirect to redirect user to the main global page if user write a false url.
I have 1 domain and three subdomains. These subdomains refer to php files and not to theme Childs or multisite.
$Subexplode = explode('.', $_SERVER['HTTP_HOST']);
$SubName = array_shift($Subexplode);
$A = 'domainname'; $B = 'subdomain1'; $V = 'subdomain2'; $H = 'subdomain3';
if($SubName === $B || $SubName === $V || $SubName === $H){
$redirectUrl="/reception";
if(is_home()){
header_remove();
wp_safe_redirect($redirectUrl);
exit;
}
}
WordPress auto php analyse refuse, inside theme files editors, from Tuesday 10 Jan to validate php file with fatal error : “Unable to send a message to the site to check for fatal errors.”
wp_safe_redirect(“https://wordpress.stackexchange.com/”) is the only function/line that interrupt wordpress analyse and validation file during update theme files.
Leave an answer