Skip to content

Commit

Permalink
Update core commands docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Mar 4, 2024
1 parent dcac4c3 commit 6648829
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,21 @@ Determines whether WordPress is installed by checking if the standard
database tables are installed. Doesn't produce output; uses exit codes
to communicate whether WordPress is installed.

**OPTIONS**

[--network]
Check if this is a multisite installation.

**EXAMPLES**

# Bash script for checking if WordPress is not installed
# Bash script for checking if WordPress is not installed.

if ! wp core is-installed 2>/dev/null; then
# WP is not installed. Let's try installing it.
wp core install
fi

# Bash script for checking if WordPress is installed, with fallback
# Bash script for checking if WordPress is installed, with fallback.

if wp core is-installed 2>/dev/null; then
# WP is installed. Let's do some things we should only do in a confirmed WP environment.
Expand Down Expand Up @@ -408,6 +410,8 @@ Runs the WordPress database update procedure.
wp core update-db [--network] [--dry-run]
~~~

**OPTIONS**

[--network]
Update databases for all sites on a network

Expand All @@ -416,14 +420,14 @@ wp core update-db [--network] [--dry-run]

**EXAMPLES**

# Update the WordPress database
# Update the WordPress database.
$ wp core update-db
Success: WordPress database upgraded successfully from db version 36686 to 35700.

# Update databases for all sites on a network
# Update databases for all sites on a network.
$ wp core update-db --network
WordPress database upgraded successfully from db version 35700 to 29630 on example.com/
Success: WordPress database upgraded on 123/123 sites
Success: WordPress database upgraded on 123/123 sites.



Expand Down
15 changes: 9 additions & 6 deletions src/Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,19 +346,21 @@ function () use ( $temp ) {
* database tables are installed. Doesn't produce output; uses exit codes
* to communicate whether WordPress is installed.
*
* ## OPTIONS
*
* [--network]
* : Check if this is a multisite installation.
*
* ## EXAMPLES
*
* # Bash script for checking if WordPress is not installed
* # Bash script for checking if WordPress is not installed.
*
* if ! wp core is-installed 2>/dev/null; then
* # WP is not installed. Let's try installing it.
* wp core install
* fi
*
* # Bash script for checking if WordPress is installed, with fallback
* # Bash script for checking if WordPress is installed, with fallback.
*
* if wp core is-installed 2>/dev/null; then
* # WP is installed. Let's do some things we should only do in a confirmed WP environment.
Expand All @@ -367,7 +369,6 @@ function () use ( $temp ) {
* # Fallback if WP is not installed.
* echo 'Hey Friend, you are in the wrong spot. Move in to your WordPress directory and try again.'
* fi
*
* @subcommand is-installed
*/
Expand Down Expand Up @@ -1223,6 +1224,8 @@ public function update( $args, $assoc_args ) {
/**
* Runs the WordPress database update procedure.
*
* ## OPTIONS
*
* [--network]
* : Update databases for all sites on a network
*
Expand All @@ -1231,14 +1234,14 @@ public function update( $args, $assoc_args ) {
*
* ## EXAMPLES
*
* # Update the WordPress database
* # Update the WordPress database.
* $ wp core update-db
* Success: WordPress database upgraded successfully from db version 36686 to 35700.
*
* # Update databases for all sites on a network
* # Update databases for all sites on a network.
* $ wp core update-db --network
* WordPress database upgraded successfully from db version 35700 to 29630 on example.com/
* Success: WordPress database upgraded on 123/123 sites
* Success: WordPress database upgraded on 123/123 sites.
*
* @subcommand update-db
*/
Expand Down

0 comments on commit 6648829

Please sign in to comment.