-
·
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…
-
·
WP_CLI::get_config()
Get values of global configuration parameters. Usage WP_CLI::get_config( $key = null ) $key (string) Get value for a specific global configuration parameter. @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 API documentation is generated from…
-
·
WP_CLI::get_php_binary()
Get the path to the PHP binary used when executing WP-CLI. Usage WP_CLI::get_php_binary() @return (string) Notes Environment values permit specific binaries to be indicated. Note: moved to Utils, left for BC. 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\get_home_dir() – Get…
-
·
WP_CLI::halt()
Halt script execution with a specific return code. Usage WP_CLI::halt( $return_code ) $return_code (integer) @return (never) Notes Permits script execution to be overloaded by WP_CLI::runcommand() When –debug is enabled, this method will also output a backtrace showing where the halt was triggered from, making it easier to identify the cause of early termination. Internal API…
-
·
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 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()…
-
·
WP_CLI::launch_self()
Run a WP-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 = [] ) $command (string) WP-CLI command to call. $args (array) Positional arguments to include when calling the command. $assoc_args (array) Associative arguments to include when…
-
·
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…