diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index bfb011c2b..d1099e92f 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -742,280 +742,38 @@ function avoid_blog_page_permalink_collision( $data, $postarr ) { add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 ); /** - * activate_sitewide_plugin() - * - * Activates a plugin site wide (for all blogs on an installation) + * @deprecated */ function activate_sitewide_plugin() { - if ( !isset( $_GET['sitewide'] ) ) - return false; - - /* Add the plugin to the list of sitewide active plugins */ - $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) ); - - /* Add the activated plugin to the list */ - $active_sitewide_plugins[ $_GET['plugin'] ] = time(); - - /* Write the updated option to the DB */ - if ( !update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ) ) - return false; - - return true; -} - -// @todo Throws warning if plugin is not set. Kinda janky. -//add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); - -/** - * deactivate_sitewide_plugin() - * - * Deactivates a plugin site wide (for all blogs on an installation) - */ -function deactivate_sitewide_plugin( $plugin = false ) { - if ( !$plugin ) - $plugin = $_GET['plugin']; - - /* Get the active sitewide plugins */ - $active_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) ); - - /* Remove the plugin we are deactivating from the list of active sitewide plugins */ - foreach ( $active_sitewide_plugins as $plugin_file => $activation_time ) { - if ( $plugin == $plugin_file ) - unset( $active_sitewide_plugins[ $plugin_file ] ); - } - - if ( !update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ) ) - wp_redirect( 'plugins.php?error=true' ); - - return true; -} -// @todo Throws warning if plugin is not set. Kinda janky. -//add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' ); -add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); - -/** - * add_sitewide_activate_row() - * - * Adds the "Activate plugin site wide" row for each plugin in the inactive plugins list. - */ -function add_sitewide_activate_row( $file, $plugin_data, $context ) { - if ( !is_super_admin() ) - return false; - - if ( 'sitewide-active' == $context ) - return false; - - if ( is_plugin_active( $file ) ) - return false; - - echo '
- | - | - |
---|---|---|
- | - | - |
- | {$plugin_data['Name']} | -{$plugin_data['Description']} |
-
- | ";
- echo ' ';
- foreach ( $action_links as $action => $link ) {
- $sep = end($action_links) == $link ? '' : ' | ';
- echo "$link$sep";
- }
- echo " |
- "; - $plugin_meta = array(); - if ( !empty($plugin_data['Version']) ) - $plugin_meta[] = sprintf(__('Version %s'), $plugin_data['Version']); - if ( !empty($plugin_data['Author']) ) { - $author = $plugin_data['Author']; - if ( !empty($plugin_data['AuthorURI']) ) - $author = '' . $plugin_data['Author'] . ''; - $plugin_meta[] = sprintf( __('By %s'), $author ); - } - if ( ! empty($plugin_data['PluginURI']) ) - $plugin_meta[] = '' . __('Visit plugin site') . ''; - - $plugin_meta = apply_filters('plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $context); - echo implode(' | ', $plugin_meta); - echo " | -