setComponent( $this ); $action->setHook( 'upgrader_process_complete' ); $action->setCallback( 'upgrade_theme' ); $action->setAcceptedArgs( 2 ); $action->setMandatory( false ); $action->setDescription( __('Handle theme upgrade','bingopress') ); $action->setFeature( $theme->getFeatures()['core_backend'] ); $this->hooks[] = $action; } /** * Handle theme upgrade * * @return void */ public function upgrade_theme( $upgrader_object, $options ){ $current_framework_path_name = theme_basename( $this->Theme->getConfig()->path ); if ($options['action'] === 'update' && $options['type'] === 'theme' ) { foreach($options['framework'] as $each_theme) { if ($each_theme == $current_framework_path_name) { /** Update options */ $this->WP->update_option( 'bingopress_config', (object) ( (array) $this->Theme->getConfig()->options + (array) $this->Theme->getConfig()->default) ); } } } } }