PHP code example of riccardooliva91 / wp-customize-nonce

1. Go to this page and download the library: Download riccardooliva91/wp-customize-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/ */

    

riccardooliva91 / wp-customize-nonce example snippets


define( 'WCN_UID_METHOD', 'default' );
define( 'WCN_TOKEN_METHOD', 'default' );

    define( 'WCN_UID_URL_PARAMETER_NAME', 'param_name' );
    define( 'WCN_TOKEN_URL_PARAMETER_NAME', 'param_name' );
    

    define( 'WCN_UID_COOKIE_NAME', 'cookie_name' );
    define( 'WCN_TOKEN_COOKIE_NAME', 'cookie_name' );
    

    define( 'WCN_UID', 'my_value' );
    define( 'WCN_TOKEN', 'my_value' );
    

define( 'WCN_VALIDATE_OLD_NONCES', false );
 
define( 'WCN_NONCE_SCHEMA', 'your_schema_name' );

substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); // note substr() offset and length
 
define( 'WCN_NONCE_OFFSET', 0 ); // Default: -12
define( 'WCN_NONCE_LENGTH', 20 ); // Default: 10