承接 amirhwsin/wpsbuilder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

amirhwsin/wpsbuilder

Composer 安装命令:

composer require amirhwsin/wpsbuilder

包简介

Build setting pages for wordpress and show in menus or submenus.

README 文档

README

Top Langs Open Source Love svg3

WpsBuilder is a tool to create wordpress like setting page or edit page.

  • Can add Menu or submenu
  • Support most of input types
  • Support callback response function

Supported inputs

All the inputs uses wordpress classes.

  • Text Input
  • Hidden input
  • Text Area
  • Select box
  • Radio Groups
  • CheckBoxes
  • Media Selector (Still in development)
  • Text (p tag)

You can also:

  • Set forms method (post,get,put,...)
  • Set Page and menu Title
  • Set page description

Installation

WpsBuilder requires WordPress v4+ and php v5.6+ to run.

Install using composer.

$ composer require amirhwsin/wpsbuilder

or install manually, first download package.

require_once('wpsBuilder/wpsBuilder.php');

Usage

WpsBuilder have simple and easy syntax, you can see some examples for menu or submenu cases.

Create Menu

$builder = new wpsBuilder();
$builder->addMenu('magical_menu')
        ->setPosition(6)
        ->setCapability('manage_options')
        ->setIconUrl('dashicons-editor-code')
        ->setPageTitle('Magic is real')
        ->setMenuTitle('See Magic')
        ->setPageDescription('This page can do some magics for you.')
        ->setFormMethod('post')
        ->input('pass', 'Password',  array(['key' => 'type', 'value' => 'password']))
        ->textArea('describe_ys', 'Describe yourself to me')
        ->hiddenInput('hidden_value','thats_right')
        ->text('yu','Username', 'amirhwisn *You cant edit this')
        ->checkbox('cbid', 'Do magic can happen?', 'Shall we play magic?', true)
        ->radio('radio', array('field_1' => 'this one', 'field_2' => 'that one'),'Which you choose?', 'that one')
        ->select('selectbox', array('key1'=> 'one', 'key2' => 'two'), 'title', 'two')
        ->media('media_id', 'Choose Profile picture')
        ->build();

Create Submenu

$builder = new wpsBuilder();
$builder->attachToMenu('magical_menu')
         ->setPageTitle('This is a little magic')
         ->setMenuTitle('Menu Title')
         ->setCapability('manage_options')
         ->setMenuSlug('magical_submenu')
         ...
         ->build();

Get Response and store data

You can call `responsefunction and pass a function as an argument and do your stuff. When you callresponseyou get a variable from your declared function can called anything thats your data that collected from form. Remember at the end you should pass an array from yourfunctionthat first element is response message like unvalid errors or success message and second one should betrueorfalse` as success or failed; In case of null passed or nothing passed no messages will be shown at the page.

$builder->response(function($res) {
        print_r($res);
        return array('message', true);
});

Todos

  • Develope media functions
  • Create a usefull document
  • Add more inputs

License

GPL2

Free Software, Hell Yeah! Feel free to contribute

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-11-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固