AP_Activate::reactivate_addons()
Description #
As of version 4.1.8 addons names are changed hence make sure to reactivate previously active addons.
Source #
File: activate.php
public function reactivate_addons() { $active_addons = get_option( 'anspress_addons', array() ); foreach ( $active_addons as $file => $active ) { if ( false !== strpos( $file, 'free/' ) ) { // Get current addons from database. $addons = get_option( 'anspress_addons', array() ); // Delete old addon name from option and update. unset( $addons[ $file ] ); update_option( 'anspress_addons', $addons ); // Try to activate by new name. $new_addon_name = str_replace( 'free/', '', $file ); // New names of addon. $new_name = array( 'category' => 'categories', 'tag' => 'tags', 'notification' => 'notifications', ); // Replace old name by new name. if ( isset( $new_name[ $new_addon_name ] ) ) { $new_addon_name = $new_name[ $new_addon_name ]; } ap_activate_addon( $new_addon_name ); } } }
Expand full source code Collapse full source code View on GitHub: activate.php:372
Add your comment