Created
February 13, 2014 19:01
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//suggestion
if(isset($_REQUEST['_wpnonce'])){
wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-' . $cbxaccountingllog->_args['plural'] );
}