我需要使用像我的wordpress插件header('Location: http://location.com');
或header("Content-disposition: attachment; filename=$fileName");
PHP头,但它似乎不怎么样。我知道他们需要在页面头被调用之前使用,所以我尝试使用init钩子:WordPress的 - 如何使用PHP头()函数
add_action('init', 'test');
function test() {
header('Location: http://location.com') ;
}
但它没有工作。
它怎么没有用?任何错误? – 2013-02-24 11:54:31