定制 laegel/wp-plugin-maker-cli 二次开发

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

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

laegel/wp-plugin-maker-cli

Composer 安装命令:

composer require laegel/wp-plugin-maker-cli

包简介

wp-plugin-maker CLI

README 文档

README

CLI for WP Plugin Maker

Install

composer global require laegel/wp-plugin-maker-cli

Yup, it's a global package, so don't install it locally or don't expect it to work!

Configure your ~/.composer/vendor/bin directory in your $PATH to be able to use it globally.

Commands

init

--name: dash-cased string, will be used to create the plugin folder name. The main namespace of the plugin will be transformed from dash-case to WordPress class naming convention (Underscore_Case)

This command will initialize a clean plugin. Must be used in your WordPress plugins directory.

generate

--name: Underscore_Cased string, will be used as class name. "_Controller" will be appended to the name. [--folder]: The folder in which the controller will be saved. Can be "All" (default value), "Admin", "Front", "CLI" or "Rest". [--type]: The controller type. Can be "controller" (default value) or "custom_type".

You can generate a new controller/custom type with this command. Must be used in your generated plugin directory.

build

To generate the actions/filters files punctually, use build. Must be used in your generated plugin directory.

watch

To generate the actions/filters files and keep working on your plugin, use watch. Must be used in your generated plugin directory.

Generated structure

my-plugin
|-- .gitignore
|-- composer.json
|-- plugin.php
|-- require-admin.php (after build)
|-- require-cli.php (after build)
|-- require-front.php (after build)
|-- require-rest.php (after build)
|-- wpm-info.php
|-- src
|   |-- Admin
|   |   |-- (empty)
|   |-- All
|   |   |-- (empty)
|   |-- CLI
|   |   |-- (empty)
|   |-- Front
|   |   |-- (empty)
|   |-- Rest
|   |   |-- (empty)
|   |-- Plugin.php
|   vendor
|   |-- (packages)

What are the other files?

  • .gitignore: As you may use Git to save your project, this file is already generated. How kind!
  • composer.json: Your plugin will be Composer-ready (but you won't have to register it on Packagist, thanks to WP-Packagist)
  • plugin.php: The plugin init file, where your plugin metadata are saved. You can update your metadata but you shouldn't change the rest unless you really know what you're doing (don't do it).
  • wpm-info.php: Weird file! But used by WPM CLI to generate files. And maybe other stuff. You might use it to keep some special plugin data (version, for example, if you don't forget to sync it)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固