我已经创建了一个表,在其中我删除了如下链接http://localhost/wptheme/wp-admin/admin.php?page=batch-op-settings&action=batch-delete&post_id=5我添加了一个代码来删除帖子
if ($action == \'batch-delete\') {
require_once (plugin_dir_path( __FILE__ ).\'views/single_batch_delete.php\');
}
所需文件中的代码为if (isset($_GET[\'action\']) == \'batch-delete\') {
global $wpdb;
$delete_batch = $wpdb->delete( \'batch_number\', array(
\'id\'=>$_GET[\'post_id\']
) );
wp_redirect( $_SERVER[\'PHP_SELF\'].\'?page="batch-op-settings"\', 302, \'Deleted\' );
}
数据行已删除,但它没有重定向到所有批次代码所有数据我使用了wp\\u重定向函数我也使用了header()函数,但它显示了此错误警告:无法修改标题信息-标题已发送
我想知道有没有更好的方法来处理这个问题,或者用当前代码来解决这个问题。