carawebs/wp-plugin-settings 问题修复 & 功能扩展

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

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

carawebs/wp-plugin-settings

Composer 安装命令:

composer require carawebs/wp-plugin-settings

包简介

Generate WordPress plugin settings from a config file.

README 文档

README

This package is in development and is not suitable for production yet.

Configuring plugin settings with the WordPress settings API can be a bit tricky.

It's difficult to keep your code DRY, and the relationship between the different functions can be tricky to set up.

It makes sense to register settings the WordPress way because your code may well have to play nicely with other developers who you're never going to meet. It also has to robust enough to survive future WordPress upgrades.

The downside of this is that you need to manage the relationship between register_setting(), add_settings_field(), add_settings_section(), add_settings_field(), settings_fields(), do_settings_sections() etc...just to output a simple form that saves a value to the WP options table.

This package is a first stab at abstracting the settings setup. You just pass in a config file which returns a PHP array. This is used to configure settings.

Usage

$optionsPageConfig = dirname(__FILE__) . '/options-page-config.php';
$menuPageConfig = dirname(__FILE__) . '/menu-page-settings-config.php';
// Settings Page
$optionsPage = new SettingsController;
$optionsPage->setOptionsPageArgs($optionsPageConfig)->initOptionsPage();

TODO

Build a fluent interface so you can add settings pages like:

<?php
$settingsPage = new Carawebs\Settings\SettingsPage($pageData);
$settingsPage->newTab('Social Media')->withSection($sectionData)->withFields($fieldsData);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL2
  • 更新时间: 2017-03-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固