register_active_banner(); } } add_action( 'upgrader_process_complete', 'jkit_update_complete', 10, 2 ); /** * Fires when the upgrader has successfully overwritten a currently installed * plugin or theme with an uploaded zip package. * * @since 2.5.11 * * @param string $package The package file. * @param array $data The new plugin or theme data. * @param string $package_type The package type ('plugin' or 'theme'). */ function jkit_overide_complete( $package, $data, $package_type ) { if ( 'plugin' === $package_type && isset( $data['Name'] ) && 'Jeg Elementor Kit' === $data['Name'] ) { \Jeg\Elementor_Kit\Banner\Banner::instance()->register_active_banner(); } } add_action( 'upgrader_overwrote_package', 'jkit_overide_complete', 10, 3 );