Ticket #14718: 14718.3.diff
File 14718.3.diff, 3.1 KB (added by , 14 years ago) |
---|
-
wp-includes/load.php
472 472 $plugins = array(); 473 473 $active_plugins = (array) get_option( 'active_plugins', array() ); 474 474 475 // Get active network plugins476 if ( is_multisite() ) {477 $active_sitewide_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );478 if ( !empty($active_sitewide_plugins) ) {479 $active_plugins = array_merge( $active_plugins, array_keys( $active_sitewide_plugins ) );480 sort( $active_plugins );481 }482 }483 484 475 // Check for hacks file if the option is enabled 485 476 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { 486 477 _deprecated_file( 'my-hacks.php', '1.5' ); … … 490 481 if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) ) 491 482 return $plugins; 492 483 484 $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; 485 493 486 foreach ( $active_plugins as $plugin ) { 494 487 if ( ! validate_file( $plugin ) // $plugin must validate as file 495 488 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 496 489 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 490 // not already included as a network plugin 491 && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) ) 497 492 ) 498 493 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 499 494 } -
wp-includes/ms-load.php
26 26 } 27 27 28 28 /** 29 * Returns array of network plugin files to be included in global scope. 30 * 31 * The default directory is wp-content/plugins. To change the default directory 32 * manually, define <code>WP_PLUGIN_DIR</code> and <code>WP_PLUGIN_URL</code> 33 * in wp-config.php. 34 * 35 * @access private 36 * @since 3.1.0 37 * @return array Files to include 38 */ 39 function wp_get_active_network_plugins() { 40 $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); 41 if ( empty( $active_plugins ) ) 42 return array(); 43 44 $active_plugins = array_keys( $active_plugins ); 45 sort( $active_plugins ); 46 47 foreach ( $active_plugins as $plugin ) { 48 if ( ! validate_file( $plugin ) // $plugin must validate as file 49 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 50 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 51 ) 52 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 53 } 54 return $plugins; 55 } 56 57 /** 29 58 * Checks status of current blog. 30 59 * 31 60 * Checks if the blog is deleted, inactive, archived, or spammed. -
wp-settings.php
152 152 } 153 153 unset( $mu_plugin ); 154 154 155 if ( is_multisite() ) { 156 foreach( wp_get_active_network_plugins() as $network_plugin ) { 157 include_once( $network_plugin ); 158 } 159 unset( $network_plugin ); 160 } 161 155 162 do_action( 'muplugins_loaded' ); 156 163 157 164 if ( is_multisite() )