LLMS_Abstract_Email_Provider::install_plugin()
Install the plugin via the WP Plugin Repo.
Return Return
(boolean|WP_Error) true
on success, error object otherwise.
Source Source
File: includes/abstracts/llms-abstract-email-provider.php
protected function install_plugin() { include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; include_once ABSPATH . 'wp-admin/includes/file.php'; include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Use the WordPress Plugins API to get the plugin download link. $api = plugins_api( 'plugin_information', array( 'slug' => $this->id, ) ); if ( is_wp_error( $api ) ) { return $api; } // Use the AJAX upgrader skin to quietly install the plugin. $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); $install = $upgrader->install( $api->download_link ); if ( is_wp_error( $install ) ) { return $install; } $activate = activate_plugin( $upgrader->plugin_info() ); if ( is_wp_error( $activate ) ) { return $activate; } return true; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.40.0 | Introduced. |