Get values of global configuration parameters.
Usage
WP_CLI::get_config( $key = null )
@return (mixed)
Notes
Provides access to --path=<path>
, --url=<url>
, and other values of
the global configuration parameters.
WP_CLI::log( 'The --url=<url> value is: ' . WP_CLI::get_config( 'url' ) );
Internal APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ codebase on every release. To suggest improvements, please submit a pull request.
Related
- WP_CLI\Utils\launch_editor_for_input() – Launch system’s $EDITOR for the user to edit some text.
- WP_CLI\Utils\get_flag_value() – Return the flag value or, if it’s not set, the $default value.
- WP_CLI\Utils\report_batch_operation_results() – Report the results of the same operation against multiple resources.
- WP_CLI\Utils\parse_str_to_argv() – Parse a string of command line arguments into an $argv-esqe variable.
- WP_CLI::confirm() – Ask for confirmation before running a destructive operation.
- WP_CLI::read_value() – Read a value, from various formats.
- WP_CLI::has_config() – Confirm that a global configuration parameter does exist.