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/ includes a number of utilities which are considered stable and meant to be used by commands.
This also means functions and methods not listed here are considered part of the private 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.. They may change or disappear at any time.
Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.
Registration
- WP_CLI::add_hook() – Schedule a callback to be executed at a certain point.
- WP_CLI::do_hook() – Execute callbacks registered to a given hook.
- WP_CLI::add_wp_hook() – Add a callback to a WordPress action or filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output..
- WP_CLI::add_command() – Register a command to WP-CLI.
Output
- WP_CLI\Utils\format_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.
- WP_CLI\Utils\make_progress_bar() – Create a progress bar to display percent completion of a given operation.
- WP_CLI::colorize() – Colorize a string for output.
- WP_CLI::line() – Display informational message without prefix, and ignore `–quiet`.
- WP_CLI::log() – Display informational message without prefix.
- WP_CLI::success() – Display success message prefixed with "Success: ".
- WP_CLI::debug() – Display debug message prefixed with "Debug: " when `–debug` is used.
- WP_CLI::warning() – Display warning message prefixed with "Warning: ".
- WP_CLI::error() – Display error message prefixed with "Error: " and exit script.
- WP_CLI::halt() – Halt script execution with a specific return code.
- WP_CLI::error_multi_line() – Display a multi-line error message in a red box. Doesn’t exit script.
Input
- 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.
- WP_CLI::get_config() – Get values of global configuration parameters.
Execution
- WP_CLI::launch() – Launch an arbitrary external process that takes over I/O.
- WP_CLI::launch_self() – Run a WP-CLI command in a new process reusing the current runtime arguments.
- WP_CLI::runcommand() – Run a WP-CLI command.
- WP_CLI::run_command() – Run a given command within the current process using the same global parameters.
System
- WP_CLI\Utils\get_home_dir() – Get the home directory.
- WP_CLI\Utils\trailingslashit() – Appends a trailing slash.
- WP_CLI\Utils\normalize_path() – Normalize a filesystem path.
- WP_CLI\Utils\get_temp_dir() – Get the system’s temp directory. Warns user if it isn’t writable.
- WP_CLI\Utils\get_php_binary() – Get the path to the PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. binary used when executing WP-CLI.
- WP_CLI::get_php_binary() – Get the path to the PHP binary used when executing WP-CLI.
Misc
- WP_CLI\Utils\write_csv() – Write data as CSV to a given file.
- WP_CLI\Utils\http_request() – Make a HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. request to a remote URLURL A specific web address of a website or web page on the Internet, such as a websiteās URL www.wordpress.org.
- WP_CLI\Utils\get_named_sem_ver() – Compare two version strings to get the named semantic version.
- WP_CLI\Utils\parse_ssh_url() – Parse a SSHSSH Secure SHell – a protocol for securely connecting to a remote system in addition to or in place of a password. url for its host, port, and path.
- WP_CLI\Utils\basename() – Locale-independent version of basename()
- WP_CLI\Utils\isPiped() – Checks whether the output of the current script is a TTY or a pipe / redirect
- WP_CLI\Utils\proc_open_compat() – Windows compatible `proc_open()`. Works around bug in PHP, and also deals with *nix-like `ENV_VAR=blah cmd` environment variable prefixes.
- WP_CLI\Utils\esc_like() – First half of escaping for LIKE special characters % and _ before preparing for MySQLMySQL MySQL is a relational database management system. A database is a structured collection of data where content, configuration and other options are stored. https://www.mysql.com/..