-
·
WP_CLI::line()
Display informational message without prefix, and ignore –quiet. Usage WP_CLI::line( $message = ” ) $message (string) Message to display to the end user. @return (void) Notes Message is written to STDOUT. WP_CLI::log() is typically recommended; WP_CLI::line() is included for historical compat. Internal API documentation is generated from the WP-CLI codebase on every release. To suggest…
-
·
WP_CLI::log()
Display informational message without prefix. Usage WP_CLI::log( $message ) $message (string) Message to write to STDOUT. Notes Message is written to STDOUT, or discarded when –quiet flag is supplied. # `wp cli update` lets user know of each step in the update process. WP_CLI::log( sprintf( ‘Downloading from %s…’, $download_url ) ); Internal API documentation is…
-
·
WP_CLI::read_value()
Read a value, from various formats. Usage WP_CLI::read_value( $raw_value, $assoc_args = [] ) $raw_value (string) $assoc_args (array) Internal API documentation is generated from the WP-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…
-
·
WP_CLI::run_command()
Run a given command within the current process using the same global parameters. Usage WP_CLI::run_command( $args, $assoc_args = [] ) $args (array) Positional arguments including command name. $assoc_args (array) Notes Use WP_CLI::runcommand() instead, which is easier to use and works better. To run a command using a new process with the same global parameters, use…
-
·
WP_CLI::runcommand()
Run a WP-CLI command. Usage WP_CLI::runcommand( $command, $options = [] ) $command (string) WP-CLI command to run, including arguments. $options (array) { Configuration options for command execution. @type bool $launch Launches a new process (true) or reuses the existing process (false). Default: true. @type bool $exit_error Halts the script on error. Default: true. @type bool|string…
-
·
WP_CLI::do_hook()
Execute callbacks registered to a given hook. Usage WP_CLI::do_hook( $when, $args ) $when (string) Identifier for the hook. …$args (mixed) Optional. Arguments that will be passed onto the callback provided by `WP_CLI::add_hook()`. @return (null|mixed) the first optional argument if optional<br /> arguments were passed, otherwise returns null. Notes See WP_CLI::add_hook() for details on WP-CLI’s internal…
-
·
WP_CLIUtilsbasename()
Locale-independent version of basename() Usage WP_CLI\Utils\basename( $path, $suffix = ” ) $path (string) $suffix (string) @return (string) Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related WP_CLI\Utils\write_csv() – Write data as CSV to a given file. WP_CLI\Utils\http_request() – Make a HTTP request to…
-
·
WP_CLI::error_multi_line()
Display a multi-line error message in a red box. Doesn’t exit script. Usage WP_CLI::error_multi_line( $message_lines ) $message_lines (array) Multi-line error message to be displayed. Notes Error message is written to STDERR. Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related WP_CLI\Utils\format_items() – Render…
-
·
WP_CLI::error()
Display error message prefixed with “Error: ” and exit script. Usage WP_CLI::error( $message, $exit = true ) $message (string|WP_Error|Exception|Throwable) Message to write to STDERR. $exit (boolean|integer) True defaults to exit(1). @return (null) Notes Error message is written to STDERR. Defaults to halting script execution with return code 1. Use WP_CLI::warning() instead when script execution should…
-
·
Running Commands Remotely
Using an SSH connection WP-CLI accepts an –ssh=[<scheme>:][<user>@]<host>[:<port>][<path>] global parameter for running a command against a remote WordPress install. This argument works similarly to how the SSH connection is parameterized in tools like scp or git. Under the hood, WP-CLI proxies commands to the ssh executable, which then passes them to the WP-CLI installed on…