From d9ddc74aaaced9891e0c3e23c07d23413f50b189 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Mon, 18 Dec 2017 06:05:36 -0800 Subject: [PATCH] Add doc changes to the command, aka source of truth --- src/Scaffold_Command.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Scaffold_Command.php b/src/Scaffold_Command.php index b415bb076..d67e79cc9 100644 --- a/src/Scaffold_Command.php +++ b/src/Scaffold_Command.php @@ -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 * * @@ -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 ) {