Scaffolding recipes that speak WordPress vocabulary and produce idiomatic PHPNomad structure. Consumed by phpnomad/cli via composer-based kit discovery.
Usually you don't install this directly. It's a transitive dependency of phpnomad/wp-plugin-starter:
composer create-project phpnomad/wp-plugin-starter my-pluginThe starter depends on this kit, so the recipes are immediately available inside the new project.
To install into an existing project:
composer require phpnomad/wp-plugin-recipes --dev| Recipe | Purpose |
|---|---|
phpnomad/wp-plugin | Bootstrap a brand-new WordPress plugin: entry file, Application class, root initializer, composer.json, tests, configuration |
Each WordPress storage primitive comes in three variants — register only, handler-against-existing-datastore, and full-stack composite — mirroring the elevator pattern from phpnomad/database-datastore in core-recipes.
| Just register | Handler against existing datastore | Full-stack composite |
|---|---|---|
phpnomad/cpt | phpnomad/cpt-handler | phpnomad/cpt-datastore |
phpnomad/taxonomy | phpnomad/taxonomy-handler | phpnomad/taxonomy-datastore |
phpnomad/option | phpnomad/option-provider | phpnomad/setting |
phpnomad/meta | phpnomad/meta-provider | phpnomad/attribute |
CPT and taxonomy recipes implement all four datastore handler interfaces (Datastore, DatastoreHasPrimaryKey, DatastoreHasWhere, DatastoreHasCounts) using WordPress core APIs. Option and meta recipes are simpler — the "handler" tier is a typed accessor service rather than a full CRUD adapter.
| Recipe | Purpose |
|---|---|
phpnomad/role | Add a WordPress user role on Ready (idempotent) |
phpnomad/admin-page | Top-level wp-admin menu page with capability gating |
phpnomad/admin-notice | Banner-style admin notice with conditional render |
phpnomad/admin-bar-item | Quick-access node in the WordPress admin bar |
phpnomad/shortcode | Register a [shortcode] tag with a render handler |
| Recipe | Purpose |
|---|---|
phpnomad/cron-job | Schedule and handle a recurring WP-Cron job |
phpnomad/scripts-bundle | Enqueue a JS bundle (front-end and/or admin), reads .asset.php for deps |
phpnomad/styles-bundle | Enqueue a CSS bundle (front-end and/or admin) |
All registration recipes scaffold a class implementing CanHandle that responds to PHPNomad's Ready event, mapped into the initializer's getListeners(). Composites pass vars through to child recipes.
Run vendor/bin/phpnomad recipes:list --all=1 inside a project to see the full list with summaries.
composer create-project phpnomad/wp-plugin-starter my-plugin
cd my-plugin
vendor/bin/phpnomad make --from=phpnomad/wp-plugin '{ "pluginName": "My Plugin", "description": "What my plugin does.", "vendor": "acme", "package": "my-plugin", "namespace": "AcmePlugin", "textDomain": "my-plugin", "authorName": "Your Name", "authorEmail": "you@example.com", "authorUrl": ""}'After the bootstrap recipe runs, you have a working PHPNomad WordPress plugin. From there, use the rest of PHPNomad's recipes to add functionality.
This kit is also a reference implementation for writing your own. The pattern:
- Create a composer package
- In its
composer.json, declareextra.phpnomad.recipesandextra.phpnomad.templatespointing to directories in your package - Drop JSON recipe files in the recipes directory and
.tpltemplate files in the templates directory - Reference recipes from other kits (this one references
phpnomad/core-recipes) via composer require, not via custom recipe-level declarations
Recipes inside your kit are referenced as <your-vendor>/<recipe-name>.
MIT