diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php index 644971f8..91203e0c 100755 --- a/class-tgm-plugin-activation.php +++ b/class-tgm-plugin-activation.php @@ -3018,6 +3018,7 @@ public function process_bulk_actions() { // Create a new instance of TGMPA_Bulk_Installer. $installer = new TGMPA_Bulk_Installer( + $this->tgmpa, new TGMPA_Bulk_Installer_Skin( array( 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), @@ -3284,14 +3285,14 @@ class TGMPA_Bulk_Installer extends Plugin_Upgrader { * * @since 2.2.0 * + * @param TGM_Plugin_Activation $tgmpa The TGMPA instance to be used by this class. * @param \Bulk_Upgrader_Skin|null $skin Installer skin. */ - public function __construct( $skin = null ) { - // Get TGMPA class instance. - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - + public function __construct( $tgmpa, $skin = null ) { parent::__construct( $skin ); + $this->tgmpa = $tgmpa; + if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { $this->clear_destination = true; }