Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save petenelson/8981536 to your computer and use it in GitHub Desktop.
Save petenelson/8981536 to your computer and use it in GitHub Desktop.
WordPress: how to validate a nonce generated by a custom WP_List_Table
<?php
class Custom_List_Table extends WP_List_Table() {
// custom list table code here
}
$list_table = new Custom_List_Table();
$list_table->prepare_items();
// verify the nonce field generated near the bulk actions menu
wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-' . $list_table->_args['plural'] );
@manchumahara
Copy link

manchumahara commented Feb 25, 2017

//suggestion
if(isset($_REQUEST['_wpnonce'])){
wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-' . $cbxaccountingllog->_args['plural'] );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment