PHP code example of farsil / wp-nonce
1. Go to this page and download the library: Download farsil/wp-nonce library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
farsil / wp-nonce example snippets
// We don't need to load themes
define( 'WP_USE_THEMES', false );
// This line assumes your Wordpress installation is in your PHP include path,
// change accordingly if it is not the case.
$gen->generate();
// In order to properly validate the generated token, the constructor parameters
// need to match those used in Nonce_Generator.
$val = new Wordpress\Nonce_Validator( 'test-nonce' );
echo $val->verify( $token );