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 core commands docs #251

Merged
merged 1 commit into from
Mar 4, 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
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