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", diff --git a/src/Config_Command.php b/src/Config_Command.php index aff4f5ea..0c166646 100644 --- a/src/Config_Command.php +++ b/src/Config_Command.php @@ -426,7 +426,8 @@ public function get( $args, $assoc_args ) { } /** - * Determines whether value of a specific constant or variable defined is truthy. + * Determines whether value of a specific defined constant or variable is truthy. + * * This determination is made by evaluating the retrieved value via boolval(). * * ## OPTIONS @@ -452,7 +453,7 @@ public function get( $args, $assoc_args ) { * * # Assert if MULTISITE is true * $ wp config is-true MULTISITE - * echo $? + * $ echo $? * 0 * * @subcommand is-true