mirror of
https://gh.wpcy.net/https://github.com/wp-cli/scaffold-package-command.git
synced 2026-06-11 02:24:26 +08:00
41 lines
999 B
Text
41 lines
999 B
Text
<?php
|
|
|
|
namespace WP_CLI\HelloWorld;
|
|
|
|
use WP_CLI;
|
|
use WP_CLI_Command;
|
|
|
|
/**
|
|
* HelloWorld command implementation.
|
|
*
|
|
* IMPORTANT: After modifying this file or adding new command classes, you need to
|
|
* regenerate the autoloader so your changes are recognized:
|
|
*
|
|
* composer dump-autoload --working-dir=$(wp package path)
|
|
*
|
|
* Alternatively, you can run `wp package update` to update your package and
|
|
* regenerate the autoloader.
|
|
*
|
|
* Learn more about Composer autoloading:
|
|
* https://getcomposer.org/doc/01-basic-usage.md#autoloading
|
|
*/
|
|
class HelloWorldCommand extends WP_CLI_Command {
|
|
|
|
/**
|
|
* Greets the world.
|
|
*
|
|
* ## EXAMPLES
|
|
*
|
|
* # Greet the world.
|
|
* $ wp hello-world
|
|
* Success: Hello World!
|
|
*
|
|
* @when before_wp_load
|
|
*
|
|
* @param array $args Indexed array of positional arguments.
|
|
* @param array $assoc_args Associative array of associative arguments.
|
|
*/
|
|
public function __invoke( $args, $assoc_args ) {
|
|
WP_CLI::success( 'Hello World!' );
|
|
}
|
|
}
|