数字化技能提升教程,数字化时代生存宝典

数字化百科 / 产品文档 / WordPress:Function Reference/wp redirect

WordPress:Function Reference/wp redirect

查看全部产品文档命名空间:WordPress

描述

将用户导向规定的absolute URI。

参数

用法

%%% <?php wp_redirect($location, $status); ?> %%%

例子

<?php wp_redirect(get_option('siteurl') . '/wp-login.php'); ?>

重新导向也可以是外部操作,和/或者使用"永远移除"代码:

<?php wp_redirect('http://www.example.com', 301); ?>