You appear to be a bot. Output may be restricted
Description
Replace all entries in "active_sitewide_plugins" and "active_plugins" with the new $to locations Note: We don't need to check if the plugin is network only, we just check both arrays We do this whether it's multisite or not.
.. we don't update the active_sitewide_plugins if we didn't get it in the first place active_sitewide_plugins is an array of plugin file names with time() active_plugins is a simple array of plugin file names ( e.g. 0 => "oik/oik.php" )
Usage
bw_replace_active_plugins( $relocations );
Parameters
- $relocations
- ( mixed ) required –
Returns
void
Source
File name: oik/admin/oik-relocate.inc
Lines:
1 to 27 of 27
function bw_replace_active_plugins( $relocations ) { $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins', array(), false ); $aswpc = count( $active_sitewide_plugins ); $active_plugins = get_option( 'active_plugins', array() ); bw_trace2( $active_plugins, "before" ); foreach ( $relocations as $from => $to ) { if ( in_array( $from, $active_sitewide_plugins ) ) { unset( $active_sitewide_plugins[ $from ] ); $active_sitewide_plugins[ $to ] = time(); } $key = array_search( $from, $active_plugins ); if ( $key !== FALSE ) { $active_plugins[ $key ] = $to; } } if ( $aswpc ) { update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ); } update_option( 'active_plugins', $active_plugins ); bw_trace2( $active_plugins, "after" ); }