From 23000640aae7858475baa8a30de43d94b786bd98 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 24 Aug 2023 15:34:02 -0400 Subject: [PATCH] Add new command to the README --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ composer.json | 1 + 2 files changed, 39 insertions(+) diff --git a/README.md b/README.md index f30d5478..49101535 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,44 @@ wp config has [--type=] [--config-file=] +### wp config is-true + +Determines whether value of a specific defined constant or variable is truthy. + +~~~ +wp config is-true [--type=] [--config-file=] +~~~ + +This determination is made by evaluating the retrieved value via boolval(). + +**OPTIONS** + + + Name of the wp-config.php constant or variable. + + [--type=] + Type of config value to retrieve. Defaults to 'all'. + --- + default: all + options: + - constant + - variable + - all + --- + + [--config-file=] + Specify the file path to the config file to be read. Defaults to the root of the + WordPress installation and the filename "wp-config.php". + +**EXAMPLES** + + # Assert if MULTISITE is true + $ wp config is-true MULTISITE + $ echo $? + 0 + + + ### wp config list Lists variables, constants, and file includes defined in wp-config.php file. diff --git a/composer.json b/composer.json index 8e076a24..c6de1d69 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ "config create", "config get", "config has", + "config is-true", "config list", "config path", "config set",