WordPress:Function Reference/wp redirect

来自站长百科
Xxf3325讨论 | 贡献2008年7月19日 (六) 15:37的版本 (新页面: == Description == Redirects the user to a specified ''absolute'' URI. == Parameters == {{Parameter|$location|string|The '''absolute''' URI which the ...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

Description

Redirects the user to a specified absolute URI.

Parameters

Usage

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

Example

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

Redirects can also be external, and/or use a "Moved Permanently" code :

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