Having a problem with wp_redirect in my plugin
-
In my plugin, I am getting an error with wp_redirect.
Here is my code:
public function update($year, $edit_id, $column1, $column2) { global $wpdb; $table_name = $wpdb->prefix . 'tableName_'.$year; $Column1 = intval($column1); $Column2 = intval($column2); $NewTotal = ($Column1 + $Column2); $wpdb->update($table_name, array('Column1' => $Column1, 'Column2' => $Column2, 'Column3' => $NewTotal), array('month_id' => $edit_id)); wp_redirect(get_option('siteurl').'/wp-admin/admin.php?page=my-plugin'); exit(); }
I know that the code is working until I get to wp_redirect.
I get the following error
Warning: Cannot modify header information – headers already sent by (output started at /home/…/public_html/wp-admin/includes/template.php:1953) in /home/…/public_html/wp-includes/pluggable.php on line 1171
Any help would be greatly appreciated
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Having a problem with wp_redirect in my plugin’ is closed to new replies.