Skip to content

Commit

Permalink
Add doc changes to the command, aka source of truth
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Dec 18, 2017
1 parent 35aa95f commit d9ddc74
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ private function _scaffold( $slug, $assoc_args, $defaults, $subdir, $templates )
}

/**
* Generates PHP, JS and CSS code for registering a Gutenberg block.
* Generates PHP, JS and CSS code for registering a Gutenberg block for a plugin or theme.
*
* Blocks are the fundamental element of the Gutenberg editor. They are the primary way in which plugins and themes can register their own functionality and extend the capabilities of the editor.
* Visit https://wordpress.org/gutenberg/handbook/block-api/ to learn more about Block API.
*
* When you scaffold a block you must use either the theme or plugin option.
*
* ## OPTIONS
*
* <slug>
Expand Down Expand Up @@ -247,6 +249,18 @@ private function _scaffold( $slug, $assoc_args, $defaults, $subdir, $templates )
* $ wp scaffold block movie --title="Movie block" --theme=simple-life
* Success: Created block 'Movie block'.
*
* # Generate a 'movie' block for the 'movies' plugin
* $ wp scaffold block movie --title="Movie block" --plugin=movies
* Success: Created block 'Movie block'.
*
* # Create a new plugin and add two blocks
* # Create plugin called books
* $ wp scaffold plugin books
* # Add a block called book to plugin books
* $ wp scaffold block book --title="Book" --plugin=books
* # Add a second block to plugin called books.
* $ wp scaffold block books --title="Book List" --plugin=books
*
* @subcommand block
*/
public function block( $args, $assoc_args ) {
Expand Down

0 comments on commit d9ddc74

Please sign in to comment.