PHP code example of darkflameninja / nuonce

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

    

darkflameninja / nuonce example snippets


$yourobj = new Nuonce($action, $nonce); // if your input == ''(in both cases),it's predefined as action = nonce_action & nonce = _wpnonce

$url = $yourobj->url($url, $name);

$yourobj->field($name);

$referer = 'http://mysite.com/something';
$yourobj->field($referer);

$yourobj->field($referer, false);

$nonce = $yourobj->create();

$retval = $yourobj->AdminReferer($queryArg);

$queryArg = '_myNonce';
$retval = $yourobj->AjaxReferer($queryArg);

$retval = $yourobj->AjaxReferer($queryArg, false);

$retval = $yourobj->verify();