📅  最后修改于: 2022-03-11 14:54:14.235000             🧑  作者: Mango
function redirect_to_home() {
if(!is_admin() && is_page('2')) {
wp_redirect(home_url());
exit();
}
}
add_action('template_redirect', 'redirect_to_home');