Content type: Handbook

  • 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 APIAPI An API or Application Programming Interface is a software intermediary that allows…

  • 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 APIAPI An API…

  • 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 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…

  • 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-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/ 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…

  • 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-CLIWP-CLI WP-CLI…

  • WP_CLIUtilsbasename()

    Locale-independent version of basename() Usage WP_CLI\Utils\basename( $path, $suffix = ” ) $path (string) $suffix (string) @return (string) 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…

  • 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 APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in…

  • 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 SSHSSH Secure SHell – a protocol for securely connecting to a remote system in addition to or in place of a password. connection 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/ accepts an –ssh=[<scheme>:][<user>@]<host>[:<port>][<path>] global…