Skip to content

Commit

Permalink
Testing toc
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Feb 25, 2024
1 parent be157d2 commit 406106f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contr

## Using

TOC will be here
~~~
wp database reset --author=<username>
~~~
Expand Down
3 changes: 2 additions & 1 deletion command.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
require_once $wpcli_database_command_autoloader;
}

WP_CLI::add_command( 'database', DatabaseCommand::class );
WP_CLI::add_command( 'database reset', [ DatabaseCommand::class, 'reset' ] );
WP_CLI::add_command( 'database test', [ DatabaseCommand::class, 'test' ] );
15 changes: 15 additions & 0 deletions src/DatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class DatabaseCommand extends WP_CLI_Command {
*
* @when after_wp_load
*
* @subcommand reset
*
* @param array $args Indexed array of positional arguments.
* @param array $assoc_args Associative array of associative arguments.
*/
Expand Down Expand Up @@ -52,6 +54,19 @@ public function reset( $args, $assoc_args ) {
$this->reset_callback( $author_obj );
}

/**
* Reset database content except one administrator user.
*
* @when after_wp_load
*
* @subcommand test
*
* @param array $args Indexed array of positional arguments.
* @param array $assoc_args Associative array of associative arguments.
*/
public function test( $args, $assoc_args ) {
}

/**
* Reset database.
*
Expand Down

0 comments on commit 406106f

Please sign in to comment.