Plugin_Upgrader::upgrade( string $plugin, array $args = array() )
Upgrade a plugin.
Parameters
- $plugin
-
(Required) Path to the plugin file relative to the plugins directory.
- $args
-
(Optional) Other arguments for upgrading a plugin package. <br>
- 'clear_update_cache'
(bool) Whether to clear the plugin updates cache if successful.<br> Default true.<br>
Default value: array()
- 'clear_update_cache'
Return
(bool|WP_Error) True if the upgrade was successful, false or a WP_Error object otherwise.
Source
File: wp-admin/includes/class-plugin-upgrader.php
Changelog
Version | Description |
---|---|
3.7.0 | The $args parameter was added, making clearing the plugin update cache optional. |
2.8.0 | Introduced. |