WordPress Help

Official documentation, learning resources, and contributor guides collected from WordPress.org.

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

    Read guide

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

    Read guide

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

    Read guide

  • WP_CLIUtilsesc_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. Usage WP_CLI\Utils\esc_like( $text ) $text (string) The raw text to be escaped. The input typed by…

    Read guide

  • WP_CLIUtilsget_temp_dir()

    Get the system’s temp directory. Warns user if it isn’t writable. Usage WP_CLI\Utils\get_temp_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…

    Read guide

  • WP_CLIUtilsisPiped()

    Checks whether the output of the current script is a TTY or a pipe / redirect Usage WP_CLI\Utils\isPiped() @return (bool) Notes Returns true if STDOUT output is being redirected to a pipe or a file; false is output is being sent directly to the terminal. If an env variable SHELL_PIPE exists, the returned result depends…

    Read guide

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

    Read guide

  • WP_CLIUtilsproc_open_compat()

    Windows compatible proc_open(). Works around bug in 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/index.php, and also deals with *nix-like ENV_VAR=blah cmd environment variable prefixes. Usage WP_CLI\Utils\proc_open_compat( $cmd, $descriptorspec, $pipes, $cwd = null,…

    Read guide

  • WP_CLIUtilsparse_str_to_argv()

    Parse a string of command line arguments into an $argv-esqe variable. Usage WP_CLI\Utils\parse_str_to_argv( $arguments ) $arguments (string) @return (array<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…

    Read guide

  • WP_CLIUtilsparse_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. Usage WP_CLI\Utils\parse_ssh_url( $url, $component = -1 ) $url (string) $component (int) @return (mixed) Notes Similar to parse_url(), but adds support for defined SSH aliases.…

    Read guide