Skip to content

gocep/wpnonce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WP-Nonce made with OOP

Replacing WordPress functional wp_nonce_* implementations with classes / objects.

Setup / Usage / How to

Install this library where you want to use it:

composer require "gocep/wpnonce"

or via editing composer.json file and then use composer update

{
    "require": {
        "gocep/wpnonce" : "1.0.0"
    }
}

WP Nonce in OOP

The wp_create_nonce is represented by the Nonce:

$context = new \WP_Nonce\Nonce( 'some-action' );

// get the current nonce
echo (string) $context;

The wp_nonce_url is represented by the NonceUrl:

$url = new \WP_Nonce\NonceUrl( 'http://the.url', 'an-action', '_nonce_id' );
$url->get_nonce_url(); // Now you receive an URL like "http://the.url?action=an-action&_nonce_id=smplnnce"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages