Make WordPress Core


Ignore:
Timestamp:
02/02/2010 09:41:17 PM (15 years ago)
Author:
ryan
Message:

Cleanup network plugin loading. Props nacin. see #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-load.php

    r12921 r12930  
    2121
    2222    return false;
    23 }
    24 
    25 /**
    26  * Returns array of sitewide plugin files to be included in global scope.
    27  *
    28  * @access private
    29  * @since 3.0.0
    30  * @return array Files to include
    31  */
    32 function ms_network_plugins() {
    33     $network_plugins = array();
    34     $deleted_sitewide_plugins = array();
    35     $wpmu_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'wpmu_sitewide_plugins' ) );
    36     foreach ( $wpmu_sitewide_plugins as $plugin_file => $activation_time ) {
    37         if ( !$plugin_file )
    38             continue;
    39 
    40         if ( !file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) )
    41             $deleted_sitewide_plugins[] = $plugin_file;
    42         else
    43             $network_plugins[] = WP_PLUGIN_DIR . '/' . $plugin_file;
    44     }
    45 
    46     if ( !empty( $deleted_sitewide_plugins ) ) {
    47         $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
    48 
    49         /* Remove any deleted plugins from the wpmu_sitewide_plugins array */
    50         foreach ( $deleted_sitewide_plugins as $plugin_file ) {
    51             unset( $wpmu_sitewide_plugins[$plugin_file] );
    52             unset( $active_sitewide_plugins[$plugin_file] );
    53         }
    54 
    55         update_site_option( 'wpmu_sitewide_plugins', $wpmu_sitewide_plugins );
    56         update_site_option( 'active_sitewide_plugins', $wpmu_sitewide_plugins );
    57     }
    58 
    59     return $network_plugins;
    6023}
    6124
Note: See TracChangeset for help on using the changeset viewer.