定制 ovidiul/wp-nonces-oop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ovidiul/wp-nonces-oop

Composer 安装命令:

composer create-project ovidiul/wp-nonces-oop

包简介

Classes that implements the WordPress Nonces functionality in an object oriented way.

README 文档

README

Package that implements the WordPress Nonces functionality (wp_nonce_*()) in an object orientated way.

Requirements

  • PHP 5.6+
  • Composer
  • WordPress 4.8.3+

Installation

Install with Composer:

$ composer require ovidiul/wp-nonces-oop:dev-master

Run the tests

To run tests, executes commands below:

$ cd vendor/thinkovi/wp-nonces-oop
$ composer install
$ vendor/bin/phpunit

Features

  • PSR-4 autoloading compliant structure
  • Unit-Testing with PHPUnit
  • Comprehensive Guides and tutorial
  • Easy to use to any Framework or even a plain php file

Usage

Initialize the nonce object generator

$generator = new NonceGenerator( 'action_name', 'nonce_parameter_name' );

Then, to generate the nonce use the generate_nonce() method:

$nonce = $generator->generate_nonce();

Generate a url with nonce parameter:

$url = $generator->generate_nonce_url( 'http://www.thinkovi.com' );

Generate nonce field:

$field = $generator->generate_nonce_field();

Nonce validation:

$is_valid = $generator->validate_nonce($nonce);

To validate a nonce received in a page through request (GET or POST) use the validate_request() method:

$is_valid = $generator->validate_request();

Credits

Liuta Ovidiu info@thinkovi.com , http://www.thinkovi.com

统计信息

  • 总下载量: 41
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固