{"id":18289948,"url":"https://github.com/mehrshaddarzi/wp-cli-trait-command","last_synced_at":"2026-01-26T22:43:09.326Z","repository":{"id":62526835,"uuid":"412696664","full_name":"mehrshaddarzi/wp-cli-trait-command","owner":"mehrshaddarzi","description":"WP-CLI Trait Package Command","archived":false,"fork":false,"pushed_at":"2023-03-05T14:06:35.000Z","size":88,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-15T10:47:04.885Z","etag":null,"topics":["wordpress-plugin","wp-cli","wp-cli-command","wp-cli-package"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehrshaddarzi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-02T05:12:07.000Z","updated_at":"2024-08-05T17:12:12.886Z","dependencies_parsed_at":"2024-08-05T17:22:14.077Z","dependency_job_id":null,"html_url":"https://github.com/mehrshaddarzi/wp-cli-trait-command","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"3c98f951c8014bf1f44edc0289ebb1c0c6bd46d5"},"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-cli-trait-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-cli-trait-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-cli-trait-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-cli-trait-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehrshaddarzi","download_url":"https://codeload.github.com/mehrshaddarzi/wp-cli-trait-command/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318327,"owners_count":20919457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress-plugin","wp-cli","wp-cli-command","wp-cli-package"],"created_at":"2024-11-05T14:08:53.757Z","updated_at":"2026-01-26T22:43:09.285Z","avatar_url":"https://github.com/mehrshaddarzi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP-CLI Trait Package Command\n\n![Packagist](https://img.shields.io/github/license/mehrshaddarzi/wp-cli-trait-command)\n![Packagist Version](https://img.shields.io/github/v/release/mehrshaddarzi/wp-cli-trait-command)\n![GitHub repo size](https://img.shields.io/github/repo-size/mehrshaddarzi/wp-cli-trait-command)\n\nGenerate plugin or php model files e.g. post-type or taxonomy for [WP-Trait](https://github.com/mehrshaddarzi/wp-trait) Package in Develop WordPress Plugin.\n\n## Installation\n\nYou can install this package with:\n\n```console\nwp package install mehrshaddarzi/wp-cli-trait-command\n```\n\n\u003e Installing this package requires WP-CLI v2 or greater. Update to the latest stable release with `wp cli update`.\n\n\n## Structure\n\n```\nNAME\n\n  wp trait\n\nDESCRIPTION\n\n  WP-CLI Trait Package Command.\n\nSYNOPSIS\n\n  wp trait \u003ccommand\u003e\n\nSUBCOMMANDS\n\n  add         Add Custom Package.\n  make        Generate Model Files.\n  remove      Remove Custom Package.\n  start       Generates starter code for a plugin\n```\n\n### Generate Plugin\n\nUse This Command:\n\n```console\nwp trait start\n```\n\nAnd fill Your Plugin information e.g. slug and namespace:\n\n```\n1/12 [--slug=\u003cslug\u003e]: wp-plugin\n2/12 [--namespace=\u003cnamespace\u003e]: WP_Plugin\n3/12 [--plugin_name=\u003ctitle\u003e]: plugin-name\n4/12 [--plugin_description=\u003cdescription\u003e]: your plugin description\n5/12 [--plugin_author=\u003cauthor\u003e]: Mehrshad Darzi\n6/12 [--plugin_author_uri=\u003curl\u003e]: https://profiles.wordpress.org/mehrshaddarzi/\n7/12 [--plugin_uri=\u003curl\u003e]: https://github.com/mehrshaddarzi/wp-trait\n8/12 [--skip-tests] (Y/n): n\n9/12 [--ci=\u003cprovider\u003e]: travis\n10/12 [--activate] (Y/n): y\n11/12 [--activate-network] (Y/n): n\n12/12 [--force] (Y/n): y\n```\n\n### Make PHP Model\n\nCreate php model:\n\n```console\nwp trait make model \u003cclass\u003e\n```\n\n\u003e 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`\n\n#### Create Model With Class Name:\n\n```console\nwp trait make model Option\n```\n\n#### Create Model With Nested Namespace:\n\n```console\nwp trait make model User/Register\n```\n\n#### Create Model With Custom global Variable in Plugin:\n\n```console\nwp trait make model User/Signup --var=register\n```\n\n### Make WordPress Post Type\n\nMake a new post-type in WordPress:\n\n```console\nwp trait make post-type \u003cclass\u003e \u003cslug\u003e \u003csingular-name\u003e\n```\n\n#### Create A new Post Type With `City` slug:\n\n```console\nwp trait make post-type City\n```\n\nAfter created You can change `register_post_type` argument in main plugin files.\n\n#### Create a new Post Type With Nested NameSpace:\n\n```console\nwp trait make post-type Post/Orders order\n```\n\n### Make WordPress Taxonomy\n\nMake a new taxonomy in WordPress:\n\n```console\nwp trait make taxonomy \u003cclass\u003e \u003cslug\u003e \u003csingular-name\u003e\n```\n\n#### Create A new Taxonomy With `Country` slug:\n\n```console\nwp trait make taxonomy Country\n```\n\nAfter create You can change register_taxonomy argument in main plugin files.\n\n#### Create a new Taxonomy With Nested NameSpace and Custom name:\n\n```console\nwp trait make taxonomy Media/Category media_cat Category\n```\n\n### Add or Remove Package\n\n```console\nwp trait add \u003cpackage\u003e\n```\n\n```console\nwp trait remove \u003cpackage\u003e\n```\n\n#### List Of Trait Package\n\n| package    | description                                                               |\n|------------|---------------------------------------------------------------------------|\n| ide-helper | Create WP-Trait method helper for developer in IDE software e.g. PHPStorm |\n| cmb2       | Add [CMB2](https://github.com/CMB2/CMB2) Framework to your plugin         |\n\n\n## Author\n\n- [Mehrshad Darzi](https://www.linkedin.com/in/mehrshaddarzi/) | PHP Full Stack and WordPress Expert\n\n## Contributing\n\nWe appreciate you taking the initiative to contribute to this project.\n\nContributing 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.\n\n### Reporting a bug\n\nThink you’ve found a bug? We’d love for you to help us get it fixed.\nBefore you create a new issue, you should [search existing issues](https://github.com/mehrshaddarzi/wp-cli-trait-command/issues) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.\n\n### Creating a pull request\n\nWant to contribute a new feature? Please first [open a new issue](https://github.com/mehrshaddarzi/wp-cli-trait-command/issues/new) to discuss whether the feature is a good fit for the project.\n\nOnce 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:\n\n1. Create a feature branch for each contribution.\n2. Submit your pull request early for feedback.\n3. Follow [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrshaddarzi%2Fwp-cli-trait-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehrshaddarzi%2Fwp-cli-trait-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrshaddarzi%2Fwp-cli-trait-command/lists"}