This commit is contained in:
Gregory Pradun
2022-07-06 18:39:20 +03:00
parent a444747fab
commit 673a951d0f

View File

@@ -363,4 +363,19 @@ function mark_redirected_user(){
setcookie('law_'.LAWCARTA_ENVIRONMENT_NAME, 1,0,"/", $cookieDomain);
}
}
add_action( "template_redirect", "mark_redirected_user" );
add_action( "template_redirect", "mark_redirected_user" );
function old_post_url_redirect(){
global $wp;
$parts = explode('/',$wp->request);
if(
$parts
&& count($parts) == 4
&& is_numeric($parts[0])
&& is_numeric($parts[1])
&& is_numeric($parts[2])
){
wp_redirect( home_url( $parts[3] ), 301 );
}
}
add_action( "template_redirect", "old_post_url_redirect" );