I am doing the following in my plugin:
Register a custom admin page and in the callback function (the last parameter of
add_submenu_page
)Redirect to another page
However, when I open the custom admin page I get the following error:
Warning: Cannot modify header information - headers already sent by (output started at ..\wp-admin\includes\template.php:1637) in ..\wp-includes\pluggable.php on line 878
Here's the callback function:
function myplugin_callback(){
wp_redirect('http://google.com');
exit;
}