my first plugin – redirecting after update
-
I’m writing my first plugin for displaying church services. When the user goes to the Manage Church Services section, created by the plugin, they see a list of church services in a table. If they want to edit one of these services, they click the edit link and are taken to a new page with an edit form on it. The form works and the record updates fine, but I would like them to be returned to the first manageservices.php page after the update has been done and I’m having problems with this.
I thought that I could use
$location = "edit.php?page=wpchurchservices/manageservices.php"; wp_redirect($location); exit();
But I get the following error message:
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\standrews\wp-admin\admin-header.php:16) in C:\wamp\www\standrews\wp-includes\pluggable.php on line 341
So I’ve no idea where to go from here. I’m learning PHP whilst doing this, so not a great programmer.
- The topic ‘my first plugin – redirecting after update’ is closed to new replies.