PHPackages                             farsil/wp-nonce - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. farsil/wp-nonce

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

farsil/wp-nonce
===============

Object oriented implementation of Wordpress nonces

v1.0.0(8y ago)113MITPHPPHP &gt;=7.0

Since Feb 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/farsil/wp-nonce)[ Packagist](https://packagist.org/packages/farsil/wp-nonce)[ RSS](/packages/farsil-wp-nonce/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

wp-nonce
========

[](#wp-nonce)

`wp-nonce` is a replacement library for wordpress nonces written in [PHP](https://php.net/). It aims to provide an object oriented interface that can be used in lieu of the wordpress `wp_nonce_*` functions.

Installation
------------

[](#installation)

Add the following entry to the `required` list in your `composer.json`:

```
"farsil/wp-nonce": "v1.0.*"

```

Or, alternatively, run:

```
$ composer require farsil/wp-nonce

```

Usage
-----

[](#usage)

Nonce generation is performed through the `Nonce_Generator` class, and nonce validation is performed through the `Nonce_Validator` class. The method names are reminiscent of the corresponding methods of the Wordpress core functions, and behave similarly, with a few differences. See the documentation for additional details.

Example
-------

[](#example)

```
