Skip to content

Commit 840962c

Browse files
committed
Testing toc
1 parent be157d2 commit 840962c

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contr
99

1010
## Using
1111

12+
### Featured Commands
13+
14+
- [wp database test](#wp-database-test)
15+
- [wp database reset](#wp-database-reset)
16+
17+
18+
This package implements the following commands:
19+
20+
21+
### wp database reset
22+
23+
Reset database content except one administrator user.
24+
1225
~~~
1326
wp database reset --author=<username>
1427
~~~
@@ -23,6 +36,16 @@ wp database reset --author=<username>
2336
# Reset database and keep `admin` user.
2437
$ wp database reset --author=admin
2538

39+
40+
41+
### wp database test
42+
43+
Reset database content except one administrator user.
44+
45+
~~~
46+
wp database test
47+
~~~
48+
2649
## Installing
2750

2851
Installing this package requires WP-CLI v2.9 or greater. Update to the latest stable release with `wp cli update`.

command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
require_once $wpcli_database_command_autoloader;
1515
}
1616

17-
WP_CLI::add_command( 'database', DatabaseCommand::class );
17+
WP_CLI::add_command( 'database reset', [ DatabaseCommand::class, 'reset' ] );
18+
WP_CLI::add_command( 'database test', [ DatabaseCommand::class, 'test' ] );

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@
4343
},
4444
"extra": {
4545
"commands": [
46-
"database reset"
46+
"database reset",
47+
"database test"
4748
],
49+
"featured-commands": [
50+
"database test",
51+
"database reset"
52+
],
4853
"readme": {
4954
"sections": [
5055
"Using",

src/DatabaseCommand.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class DatabaseCommand extends WP_CLI_Command {
2222
*
2323
* @when after_wp_load
2424
*
25+
* @subcommand reset
26+
*
2527
* @param array $args Indexed array of positional arguments.
2628
* @param array $assoc_args Associative array of associative arguments.
2729
*/
@@ -52,6 +54,19 @@ public function reset( $args, $assoc_args ) {
5254
$this->reset_callback( $author_obj );
5355
}
5456

57+
/**
58+
* Reset database content except one administrator user.
59+
*
60+
* @when after_wp_load
61+
*
62+
* @subcommand test
63+
*
64+
* @param array $args Indexed array of positional arguments.
65+
* @param array $assoc_args Associative array of associative arguments.
66+
*/
67+
public function test( $args, $assoc_args ) {
68+
}
69+
5570
/**
5671
* Reset database.
5772
*

0 commit comments

Comments
 (0)