Skip to content

Commit 4ae0066

Browse files
authored
Merge pull request #311 from wp-cli/deprecate-scaffold-block
2 parents 275d2c3 + eb7e533 commit 4ae0066

File tree

2 files changed

+6
-42
lines changed

2 files changed

+6
-42
lines changed

README.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ Generates PHP, JS and CSS code for registering a Gutenberg block for a plugin or
9191
wp scaffold block <slug> [--title=<title>] [--dashicon=<dashicon>] [--category=<category>] [--theme] [--plugin=<plugin>] [--force]
9292
~~~
9393

94-
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.
94+
**Warning: `wp scaffold block` is deprecated.**
9595

96-
Visit the [Gutenberg handbook](https://wordpress.org/gutenberg/handbook/block-api/) to learn more about Block API.
96+
The official script to generate a block is the [@wordpress/create-block](https://developer.wordpress.org/block-editor/designers-developers/developers/packages/packages-create-block/) package.
9797

98-
When you scaffold a block you must use either the theme or plugin option. The latter is recommended.
98+
See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/) for a complete walk-through.
9999

100100
**OPTIONS**
101101

@@ -129,24 +129,6 @@ When you scaffold a block you must use either the theme or plugin option. The la
129129
[--force]
130130
Overwrite files that already exist.
131131

132-
**EXAMPLES**
133-
134-
# Generate a 'movie' block for the 'movies' plugin
135-
$ wp scaffold block movie --title="Movie block" --plugin=movies
136-
Success: Created block 'Movie block'.
137-
138-
# Generate a 'movie' block for the 'simple-life' theme
139-
$ wp scaffold block movie --title="Movie block" --theme=simple-life
140-
Success: Created block 'Movie block'.
141-
142-
# Create a new plugin and add two blocks
143-
# Create plugin called books
144-
$ wp scaffold plugin books
145-
# Add a block called book to plugin books
146-
$ wp scaffold block book --title="Book" --plugin=books
147-
# Add a second block to plugin called books.
148-
$ wp scaffold block books --title="Book List" --plugin=books
149-
150132

151133

152134
### wp scaffold child-theme

src/Scaffold_Command.php

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ private function scaffold( $slug, $assoc_args, $defaults, $subdir, $templates )
204204
/**
205205
* Generates PHP, JS and CSS code for registering a Gutenberg block for a plugin or theme.
206206
*
207-
* 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.
207+
* **Warning: `wp scaffold block` is deprecated.**
208208
*
209-
* Visit the [Gutenberg handbook](https://wordpress.org/gutenberg/handbook/block-api/) to learn more about Block API.
209+
* The official script to generate a block is the [@wordpress/create-block](https://developer.wordpress.org/block-editor/designers-developers/developers/packages/packages-create-block/) package.
210210
*
211-
* When you scaffold a block you must use either the theme or plugin option. The latter is recommended.
211+
* See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/) for a complete walk-through.
212212
*
213213
* ## OPTIONS
214214
*
@@ -242,24 +242,6 @@ private function scaffold( $slug, $assoc_args, $defaults, $subdir, $templates )
242242
* [--force]
243243
* : Overwrite files that already exist.
244244
*
245-
* ## EXAMPLES
246-
*
247-
* # Generate a 'movie' block for the 'movies' plugin
248-
* $ wp scaffold block movie --title="Movie block" --plugin=movies
249-
* Success: Created block 'Movie block'.
250-
*
251-
* # Generate a 'movie' block for the 'simple-life' theme
252-
* $ wp scaffold block movie --title="Movie block" --theme=simple-life
253-
* Success: Created block 'Movie block'.
254-
*
255-
* # Create a new plugin and add two blocks
256-
* # Create plugin called books
257-
* $ wp scaffold plugin books
258-
* # Add a block called book to plugin books
259-
* $ wp scaffold block book --title="Book" --plugin=books
260-
* # Add a second block to plugin called books.
261-
* $ wp scaffold block books --title="Book List" --plugin=books
262-
*
263245
* @subcommand block
264246
*/
265247
public function block( $args, $assoc_args ) {

0 commit comments

Comments
 (0)