xwp/wp-safe-input 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

xwp/wp-safe-input

Composer 安装命令:

composer require xwp/wp-safe-input

包简介

README 文档

README

Build Status Coverage Status

A helper library for validating and sanitizing form input data.

Setup

Use Composer to add this library to your project:

composer require xwp/wp-safe-input

Usage

See the sample plugin in the example directory.

The core logic looks like this:

use XWP\SafeInput\PostMeta;
use XWP\SafeInput\Request;

add_action( 'save_post', function ( $post_id ) {
	$request = new Request( INPUT_POST );
	$meta = new PostMeta( $post_id );

	if ( $request->verify_nonce( 'nonce-action', 'nonce-input-name' ) && $meta->can_save() ) {
		if ( 'on' === $request->param( 'input-field-name' ) ) {
			// Update post meta value.
		} else {
			// Delete post meta value.
		}
	}
} );

TODO: Document what happens in the example above.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固