PluginCommand final class
Minn\Cli\PluginCommand · public/minn/src/Minn/Cli/PluginCommand.php · 406 lines
`wp plugin list|install|update|activate|deactivate|delete`: the inventory and the fleet's install/update/delete.
Constants and properties
| private | FIELDS = array ( 0 => 'name', 1 => 'status', 2 => 'update', 3 => 'version', 4 => 'update_version', 5 => 'auto_update', ) |
Public
| method | list(array $args, array $assocArgs): void# | Lists installed plugins, must-use plugins, and drop-ins. ## OPTIONS [--status=<status>] : Filter to one status: active, inactive, must-use, or dropin. [--field=<field>] : Prints the value of a single field for each plugin. [--fields=<fields>] : Limit the output to specific object fields. [--format=<format>] : Render output in a particular format. --- default: table options: - table - csv - json - count - yaml --- |
| method | activate(array $args, array $assocArgs): void# | Activates one or more plugins: a WordPress plugin joins active_plugins (its stored state; the engine runs none of its code), a Minn extension joins the engine's own list. ## OPTIONS <plugin>... : One or more plugins to activate. |
| method | deactivate(array $args, array $assocArgs): void# | Deactivates one or more plugins. ## OPTIONS <plugin>... : One or more plugins to deactivate. |
| method | install(array $args, array $assocArgs): void# | Installs one or more plugins from the plugin directory, a zip, or a URL. ## OPTIONS <plugin|zip|url>... : A plugin slug, a local zip path, or a zip URL. [--version=<version>] : Install that version from the directory instead of the current one. [--force] : Overwrite an installed copy of the same folder. [--activate] : Activate the plugin after it is installed (or if it is already on disk). |
| method | update(array $args, array $assocArgs): void# | Updates one or more plugins from the plugin directory. ## OPTIONS [<plugin>...] : One or more plugins to update. [--all] : If set, all plugins that have updates will be updated. [--exclude=<name>] : Comma separated list of plugin names that should be excluded from updating. [--minor] : Only perform updates for minor releases. [--patch] : Only perform updates for patch releases. [--format=<format>] : Render output in a particular format. --- default: table options: - table - csv - json - summary --- [--version=<version>] : If set, the plugin will be updated to the specified version. [--dry-run] : Preview which plugins would be updated. |
| method | delete(array $args, array $assocArgs): void# | Deletes plugin files without deactivating. ## OPTIONS [<plugin>...] : One or more plugin folders to delete. |
| method | is_installed(array $args, array $assocArgs): void# | Checks if a given plugin is installed. Exit 0 when it is, 1 when not. ## OPTIONS <plugin> : The plugin folder to check. |
| method | is_active(array $args, array $assocArgs): void# | Checks if a given plugin is active. Exit 0 when it is, 1 when not. ## OPTIONS <plugin> : The plugin folder to check. [--network] : Ignored on a single site. |
| method | search(array $args, array $assocArgs): void# | Searches the plugin directory. ## OPTIONS <search> : The string to search for. [--page=<page>] : Optional page to display. --- default: 1 --- [--per-page=<per-page>] : Optional number of results to display. --- default: 10 --- [--field=<field>] : Prints the value of a single field for each plugin. [--fields=<fields>] : Limit the output to specific object fields. Defaults to name,slug,rating. [--format=<format>] : Render output in a particular format. --- default: table options: - table - csv - json - count - yaml --- |
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | switch(array $slugs, string $verb): void# | The reference's wording, line for line: one warning per miss, a Success summary or an Error with none done. |
| private | pinVersion(array $args, string $version): void# | `--version` on update force-installs that release using the install wording. |
| private | activateFolder(Minn\Cli\Runtime $runtime, string $folder): void# | |
| private | plain(string $message): string# | A refusal's HTML message as WP-CLI words it in a warning: links dropped, tags stripped, no "Error:" lead. |
Nothing matches.