Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scaffold command examples #329

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ wp scaffold

**EXAMPLES**

# Generate a new plugin with unit tests
# Generate a new plugin with unit tests.
$ wp scaffold plugin sample-plugin
Success: Created plugin files.
Success: Created test files.

# Generate theme based on _s
# Generate theme based on _s.
$ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe"
Success: Created theme 'Sample Theme'.

# Generate code for post type registration in given theme
# Generate code for post type registration in given theme.
$ wp scaffold post-type movie --label=Movie --theme=simple-life
Success: Created /var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php
Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.



Expand Down Expand Up @@ -93,9 +93,9 @@ wp scaffold block <slug> [--title=<title>] [--dashicon=<dashicon>] [--category=<

**Warning: `wp scaffold block` is deprecated.**

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.
The official script to generate a block is the [@wordpress/create-block](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) package.

See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/) for a complete walk-through.
See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/tutorial/) for a complete walk-through.

**OPTIONS**

Expand Down Expand Up @@ -274,7 +274,7 @@ The following files are generated by default:
* `tests/test-sample.php` is a sample file containing the actual tests.
* `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.

Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/plugin-unit-tests/).
Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).

**ENVIRONMENT**

Expand Down Expand Up @@ -412,7 +412,7 @@ The following files are generated by default:
* `tests/test-sample.php` is a sample file containing the actual tests.
* `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.

Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/plugin-unit-tests/).
Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).

**ENVIRONMENT**

Expand Down
16 changes: 8 additions & 8 deletions src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
*
* ## EXAMPLES
*
* # Generate a new plugin with unit tests
* # Generate a new plugin with unit tests.
* $ wp scaffold plugin sample-plugin
* Success: Created plugin files.
* Success: Created test files.
*
* # Generate theme based on _s
* # Generate theme based on _s.
* $ wp scaffold _s sample-theme --theme_name="Sample Theme" --author="John Doe"
* Success: Created theme 'Sample Theme'.
*
* # Generate code for post type registration in given theme
* # Generate code for post type registration in given theme.
* $ wp scaffold post-type movie --label=Movie --theme=simple-life
* Success: Created /var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php
* Success: Created '/var/www/example.com/public_html/wp-content/themes/simple-life/post-types/movie.php'.
*
* @package wp-cli
*/
Expand Down Expand Up @@ -206,9 +206,9 @@ private function scaffold( $slug, $assoc_args, $defaults, $subdir, $templates )
*
* **Warning: `wp scaffold block` is deprecated.**
*
* 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.
* The official script to generate a block is the [@wordpress/create-block](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/) package.
*
* See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/) for a complete walk-through.
* See the [Create a Block tutorial](https://developer.wordpress.org/block-editor/getting-started/tutorial/) for a complete walk-through.
*
* ## OPTIONS
*
Expand Down Expand Up @@ -710,7 +710,7 @@ public function plugin( $args, $assoc_args ) {
* * `tests/test-sample.php` is a sample file containing the actual tests.
* * `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.
*
* Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/plugin-unit-tests/).
* Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).
*
* ## ENVIRONMENT
*
Expand Down Expand Up @@ -762,7 +762,7 @@ public function plugin_tests( $args, $assoc_args ) {
* * `tests/test-sample.php` is a sample file containing the actual tests.
* * `.phpcs.xml.dist` is a collection of PHP_CodeSniffer rules.
*
* Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/plugin-unit-tests/).
* Learn more from the [plugin unit tests documentation](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/).
*
* ## ENVIRONMENT
*
Expand Down