我在任何地方都找不到这方面的任何信息,但我肯定我以前见过。
我想让一个用户在安装后进入我的插件的设置页面,所以要么自动重定向,要么将“返回插件”链接更改为自定义链接。
提前感谢
SOLVED
function myplugin_activate() {
// TODO: Install your plugin here.
// I don\'t know of any other redirect function, so this\'ll have to do.
wp_redirect(admin_url(\'options-general.php?page=myplugin_settings\'));exit;
// You could use a header(sprintf(\'Location: %s\', admin_url(...)); here instead too.
}
register_activation_hook(__FILE__, \'myplugin_activate\');
@Zack-你的方法很好用,但是你在wp\\u重定向后忘记退出了。(来源http://codex.wordpress.org/Function_Reference/wp_redirect)非常感谢