WP-CLI Trait Package Command

Overview

WP-CLI Trait Package Command

Packagist Packagist Version GitHub repo size

Generate plugin or php model files e.g. post-type or taxonomy for WP-Trait Package in Develop WordPress Plugin.

Installation

You can install this package with:

wp package install mehrshaddarzi/wp-cli-trait-command

Installing this package requires WP-CLI v2 or greater. Update to the latest stable release with wp cli update.

Structure

NAME

  wp trait

DESCRIPTION

  WP-CLI Trait Package Command.

SYNOPSIS

  wp trait 

SUBCOMMANDS

  start       Generate New Plugin With Wp-trait Structure
  make        Make PHP Model file

Generate Plugin

Use This Command:

wp trait start

And fill Your Plugin information e.g. slug and namespace:

1/12 [--slug=
   
    ]: wp-plugin
2/12 [--namespace=
    
     ]: WP_Plugin
3/12 [--plugin_name=
     ]: plugin-name
4/12 [--plugin_description=
     
      ]: q
5/12 [--plugin_author=
      
       ]: Mehrshad Darzi
6/12 [--plugin_author_uri=
       
        ]: https://profiles.wordpress.org/mehrshaddarzi/ 7/12 [--plugin_uri=
        
         ]: https://github.com/mehrshaddarzi/wp-trait 8/12 [--skip-tests] (Y/n): n 9/12 [--ci=
         
          ]: travis 10/12 [--activate] (Y/n): y 11/12 [--activate-network] (Y/n): n 12/12 [--force] (Y/n): y 
         
        
       
      
     
    
   

Make PHP Model

Create php model:

wp trait make model 
   

Notice: To execute the command to create a model or post-type, you must change the directory of your terminal address from the WordPress root to the plugin folder. for example first run cd wp-content/plugins/my-plugin command and then run wp trait make

Create Model With Class Name:

wp trait make model Option

Create Model With Nested Namespace:

wp trait make model User/Register

Create Model With Custom global Variable in Plugin:

wp trait make model User/Signup --var=register

Make WordPress Post Type

Make a new post-type in WordPress:

wp trait make post-type 
    
     
     
    
   

Create A new Post Type With City slug:

wp trait make post-type City

After created You can change register_post_type argument in main plugin files.

Create a new Post Type With Nested NameSpace:

wp trait make post-type Post/Orders order

Make WordPress Taxonomy

Make a new taxonomy in WordPress:

wp trait make taxonomy 
    
     
     
    
   

Create A new Taxonomy With Country slug:

wp trait make taxonomy Country

After create You can change register_taxonomy argument in main plugin files.

Create a new Taxonomy With Nested NameSpace and Custom name:

wp trait make taxonomy Media/Category media_cat Category

Author

Contributing

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Reporting a bug

Think you’ve found a bug? We’d love for you to help us get it fixed. Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience:

  1. Create a feature branch for each contribution.
  2. Submit your pull request early for feedback.
  3. Follow PSR-2 Coding Standards.
You might also like...
PHP Version Manager for the CLI on Windows

This package has a much more niche use case than nvm does. When developing on Windows and using the integrated terminal, it's quite difficult to get those terminals to actually listen to PATH changes.

Library for creating CLI commands or applications

Console Motivation: this library purpose is to provide a lighter and more robust API for console commands and/or applications to symfony/console. It c

PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace

MODX Extra Publisher PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace. Installation global? local? To install packag

A handy set of Stringable mixins for CLI text.

Laravel Colorize A mixin for Laravel's Stringable to easily apply colors and styles to CLI text. Installation You can install the package via Composer

PHP CLI project to get an appointment from https://vacunacovid.catsalut.gencat.ca

covid_vaccine_bcn PHP CLI project to get an appointment from https://citavacunacovid19.catsalut.gencat.cat/Vacunacio_Covid/Vacunacio/VacunacioCovidRes

PHP CLI to add latest release notes to a CHANGELOG

changelog-updater A PHP CLI to update a CHANGELOG following the "Keep a Changelog" format with the latest release notes. Want to automate the process

unofficial cli built using php which can be used to upload and download files from anonfiles.com

Anonfiles CLI Table of Contents Introduction Features Screenshots Installation Contributing License Introduction Anon Files CLI can upload and downloa

A CLI program that helps you check your endpoints by requesting the given servers and send a report message in any supported channel like Telegram

API Monitor A CLI program that help you check your endpoints by requesting the given servers and send a report message in any supported channel ( Tele

Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and more.
Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and more.

Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and

Comments
  • Add IDE Help

    Add IDE Help

    add command:

    wp trait add ide-helper
    
    wp trait remove ide-helper
    

    create file ide-helper.php:

    <?php
    
    // Use for PHPStorm IDE
    if (!function_exists('plugin_slug')) {
    	function plugin_slug()
    	{
    		global $plugin_slug;
    		return $plugin_slug;
    	}
    }
    

    Add $plugin_slug before New instance in main file plugin.

    $plugni_slug = new PLUGIN_SLUG();
    
    opened by mehrshaddarzi 0
  • add command

    add command

    add command:

    • [x] wp trait add cmb2 (https://github.com/CMB2/CMB2)
    • [ ] wp trait add tgma (http://tgmpluginactivation.com/)
    • [ ] wp trait add redux (https://github.com/reduxframework/redux-framework])
    • [ ] wp trait add eloquent (https://github.com/tareq1988/wp-eloquent)
    • [ ] wpdb wrapper (https://github.com/stellarwp/db)
    opened by mehrshaddarzi 0
Releases(v1.0.3)
Owner
Mehrshad Darzi
Full Stack PHP and WordPress Developer
Mehrshad Darzi
Sylius plugin to define a command cli context (ChannelContext)

Cli Context Plugin This plugin provide a default channel context for your Symfony Command. When Sylius load a resource implements Sylius\Component\Res

null 4 Dec 15, 2022
The Platform.sh CLI is the official command-line interface for Platform.sh

The Platform.sh CLI is the official command-line interface for Platform.sh. Use this tool to interact with your Platform.sh projects, and to build them locally for development purposes.

Platform.sh 222 Dec 29, 2022
Image Optimize Command - Easily optimize images using WP CLI

Image Optimize Command is a WP CLI wrapper for spatie/image-optimizer which optimize gif, jpeg, jpg, png, svg, webp images by running them through a chain of various image optimization tools.

Typist Tech Limited 157 Dec 13, 2022
A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!

CLIFramework CLIFramework is a command-line application framework, for building flexiable, simple command-line applications. Commands and Subcommands

Yo-An Lin 428 Dec 13, 2022
A CLI starter pack for developing a package with Laravel 5

Laravel PackMe Laravel PackMe is a project starter pack which combine all basic stuff (src, tests) in order to develop a package for Laravel 5.*. It t

Pierre Tondereau 63 Dec 29, 2021
A CLI tool to check whether a specific composer package uses imported symbols that aren't part of its direct composer dependencies

A CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package. This will prevent you from using "soft" dependencies that are not defined within your composer.json require section.

Matthias Glaub 722 Dec 30, 2022
🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.

Contents Minimum Requirements Installation Upgrading Usage Quick Setup Examples API Appearance Menu Title Colour Width Padding Margin Borders Exit But

PHP School 1.9k Dec 28, 2022
An Elegant CLI Library for PHP

Commando An Elegant PHP CLI Library Commando is a PHP command line interface library that beautifies and simplifies writing PHP scripts intended for c

Nate Good 793 Dec 25, 2022
Cilex a lightweight framework for creating PHP CLI scripts inspired by Silex

Cilex, a simple Command Line Interface framework Cilex is a simple command line application framework to develop simple tools based on Symfony2 compon

null 624 Dec 6, 2022