Download the PHP package moderntribe/square1-generators without Composer
On this page you can find all versions of the php package moderntribe/square1-generators. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moderntribe/square1-generators
More information about moderntribe/square1-generators
Files in moderntribe/square1-generators
Package square1-generators
Short Description Code generators for Square One
License GPL-2.0-only
Informations about the package square1-generators
Square One Generator
A code generator utility to automate some of the repetitive tasks of building out a project with Square One. The WP CLI commands provided by this package will create stub files to set you on the right path for your custom work.
Component Generator
Generates the assorted files required for a theme component.
Example usage:
This will create six files for you in the theme:
components/link/link.php
components/link/Link_Controller.php
components/link/index.pcss
components/link/css/link.pcss
components/link/index.js
components/link/js/link.js
The template (link.php
) and the Controller class (Link_Controller.php
) will be stubbed out with
common properties.
Use --no-template
to skip the template.
Use --no-controller
to skip the Controller class.
Use --no-css
to skip the CSS files.
Use --no-js
to skip the JS files.
The --dry-run
flag will show you the files the command would create, without writing to the file system.
You can use this command to generate components in nested directories. For example,
wp s1 generate component content/event ...
would create the component in components/content/event
.
All PHP classes will have their namespaces adjusted to reflect their position in the hierarchy.
Post Type Generator
Generates the files required for a custom post type.
Example usage:
This will create three files for you in the core plugin:
src/Post_Types/Document/Document.php
src/Post_Types/Document/Config.php
src/Post_Types/Document/Subscriber.php
And it will add a reference to the subscriber in Tribe\Project\Core
.
Taxonomy Generator
Generates the files required for a custom taxonomy.
Example usage:
wp s1 generate tax classification --post-types="page,post" --single="Classification" --plural="Classifications"
This will create three files for you in the core plugin:
src/Taxonomies/Classification/Classification.php
src/Taxonomies/Classification/Config.php
src/Taxonomies/Classification/Subscriber.php
And it will add a reference to the subscriber in Tribe\Project\Core
.
Block Generator
Generate the files required to register a new block with ACF.
Example usage:
This will create two files for you in the core plugin:
src/Blocks/Types/Image_Gallery/Image_Gallery.php
src/Blocks/Types/Image_Gallery/Image_Gallery_Model.php
And create the block template in the theme:
blocks/imagegallery.php
And then delegates to the component generator (see above) to generate
the image_gallery
component.
The --dry-run
flag will show you the files the command would create, without writing to the file system.
Example with Post Loop Field Middleware:
Settings Page Generator
TODO: write documentation for the settings page generator
CLI Command Generator
TODO: write documentation for the CLI command generator
Image Size Generator
Adds an image size to the core plugin's Image_Sizes
class.
Example usage:
This will add the constant TEST_SIZE
to the Image_Sizes
class and add this definition to the
$sizes
array:
All versions of square1-generators with dependencies
moderntribe/square1-container Version ^4.2
php Version >=7.4