Having a problem with wp_safe_redirect(admin_url('index.php'))

** Nevermind. Figured it out. I was generated my menus on the handle form pass as well as the display form pass. Hah! **

I'm calling this at the end of executing the form handler in my plug-in. At this point, I haven't outputted anything (and I checked all my PHP code to make sure there's no blank lines or anything outside the PHP).

But when I call it, I get this error:

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-admin\admin-header.php:18) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 868

Now, this seems to make sense, since I'm the admin interface. But if that's the case, this approach should never work because the admin interface will always output header data before my code.

So is there a better/workable way to redirect to another admin page upon completion of my plug-in's processing?

No Responses Yet

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.