The Correct Way to Use Nonce Field without Settings API

This is a very basic nonce setup for a plugin: Create your nonce input in the form: wp_nonce_field( basename(__FILE__), $nonce_key ); Then check your nonce once submitted: if ( empty($_POST[$nonce_key]) || ! wp_verify_nonce( $_POST[$nonce_key], basename(__FILE__) ) ) return; basename(FILE) just uses the current filename (eg: plugin_options.php) to create the nonce string. You need to provide … Read more

Admin Subpages without Menu entry

The best thing you can do here is to call them with a $_GET parameter, and just register the first site to the menu. so for example, when you registered admin.php?page=my-plugin/admin/submenupage.php, you have the submenupage.php structured like this: if ( !isset( $_GET[‘section’] ) ) { include(‘mainpage.php’); } else if ($_GET[‘section’] == ‘hiddenpage1’ ){ include(‘mainpage.php’); } … Read more