marcosnunesmbs/wpcreator 问题修复 & 功能扩展

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

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

marcosnunesmbs/wpcreator

最新稳定版本:1.1.1

Composer 安装命令:

composer require marcosnunesmbs/wpcreator

包简介

A Wordpress CPT builder

README 文档

README

Build Status Latest Stable Version License

Description

A simple php cli to create Wordpress Custom Post Types, Elementor's Widgets and another utilityes by yaml files.

Getting Started

Install

This CLI application is a Wordpress Custom Post Type Builder written in PHP and is installed using Composer:

composer global require marcosnunesmbs/wpcreator

Usage

Creating a Custom Post Type

  1. Create a file example.yaml or example.json with basic informations:
name: Cars
labels:
  plural: Cars
  singular: Car
  menuName: Cars
  slug: cars
supports: title thumbnail
taxonomies:
  - name: Manufacturer
    singular: Manufacturer
    plural: Manufacturers
    slug: manufacturer
    hierarchical: 'true'
metaboxes:
  - name: form_car
    title: Form
    postmetas:
      - id: model_car
        label: Model
        type: text
      - id: old_car
        label: Old
        type: text
  - name: form2
    title: Form 2
    postmetas:
      - id: purchase_date
        label: Purchase Date
        type: date
{
    "name": "Cars",
    "labels": {
      "plural": "Cars",
      "singular": "Car",
      "menuName": "Cars"
    },
    "slug": "car",
    "supports": "title thumbnail",
    "taxonomies": [
      {
        "name": "Manufacturer",
        "singular": "Manufacturer",
        "plural": "Manufacturers",
        "slug": "manufacturer",
        "hierarchical": "true"
      }
    ],
    "metaboxes": [
      {
        "name": "form_car",
        "title": "Form",
        "postmetas": [
          {
            "id": "model_car",
            "label": "Model",
            "type": "text"
          },
          {
            "id": "old_car",
            "label": "Old",
            "type": "text"
          }
        ]
      },
      {
        "name": "form2",
        "title": "Form 2",
        "postmetas": [
          {
            "id": "purchase_date",
            "label": "Purchase Date",
            "type": "date"
          }
        ]
      }
    ]
  }
  

For more examples

Parameter Description
name The name of CPT and File
plural The plural name of CPT
singular The singular name of CPT
menuName The Menu name of CPT
slug The slug name of CPT
supports The list of supports separetade by spaces. See more arguments on documentation.
taxonomies array of taxonomies
name Taxonomy Name (Singular)
title Title of taxonomie
postmetas Array of postmetas
id Postmeta id
label Postmeta label
type Type of postmeta input
  1. Execute the command create:cpt folowing the yaml path:
wpcreator create:cpt example.yaml

This command will create a folder named "output" with the file Cars.php which the basic Custom Post Type configuration customized.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-30