Content type: Handbook

  • WP_CLIUtilsformat_items()

    Render a collection of items as an ASCII table, JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML., CSV, YAML, list of ids, or count. Usage WP_CLI\Utils\format_items( $format, $items, $fields ) $format…

  • WP_CLIUtilsget_flag_value()

    Return the flag value or, if it’s not set, the $default value. Usage WP_CLI\Utils\get_flag_value( $assoc_args, $flag, $default = null ) $assoc_args (array<string|int,string|bool>) Arguments array. $flag (string|int) Flag to get the value. $default (string|bool|int|null) Default value for the flag. Default: NULL. @return (string|bool|int|null) Notes Because flags can be negated (e.g. –no-quiet to negate –quiet), this function…

  • WP_CLIUtilsget_home_dir()

    Get the home directory. Usage WP_CLI\Utils\get_home_dir() @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 Line Interface for WordPress, used to do administrative and…

  • WP_CLIUtilsget_named_sem_ver()

    Compare two version strings to get the named semantic version. Usage WP_CLI\Utils\get_named_sem_ver( $new_version, $original_version ) $new_version (string) $original_version (string) @return (string) ‘minor’, ‘patch’ 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…

  • WP_CLI::has_config()

    Confirm that a global configuration parameter does exist. Usage WP_CLI::has_config( $key ) $key (string) Config parameter key to check. @return (bool) 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::launch_self()

    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 in a new process reusing the current runtime arguments. Usage WP_CLI::launch_self( $command, $args = [], $assoc_args = [], $exit_on_error = true, $return_detailed = false, $runtime_args =…

  • WP_CLI::launch()

    Launch an arbitrary external process that takes over I/O. Usage WP_CLI::launch( $command, $exit_on_error = true, $return_detailed = false ) $command (string) External process to launch. $exit_on_error (boolean) Whether to exit if the command returns an elevated return code. $return_detailed (boolean) Whether to return an exit status (default) or detailed execution results. @return (int|ProcessRun) command exit…

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