Wordpress - How to remove _wp_http_referer from URL when using WP_List_table?
As the last commenter on that Q suggested, you should probably check for actions, remove the query args and redirect. Something like:
$doaction = $wp_list_table->current_action();
if ( $doaction && isset( $_REQUEST['SOMEVAR'] ) ) {
// do stuff
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
Let me help you! Overwrite the parent method display_tablenav of WP_List_Table class removing the wp_nonce_field execution.
/**
* Generates the table navigation above or bellow the table and removes the
* _wp_http_referrer and _wpnonce because it generates a error about URL too large
*
* @param string $which
* @return void
*/
function display_tablenav( $which )
{
?>
<div class="tablenav <?php echo esc_attr( $which ); ?>">
<div class="alignleft actions">
<?php $this->bulk_actions(); ?>
</div>
<?php
$this->extra_tablenav( $which );
$this->pagination( $which );
?>
<br class="clear" />
</div>
<?php
}