Ticket #14718: 14718.2.diff
File 14718.2.diff, 2.9 KB (added by , 14 years ago) |
---|
-
wp-includes/load.php
458 458 } 459 459 460 460 /** 461 * Returns array of network plugin files to be included in global scope. 462 * 463 * The default directory is wp-content/plugins. To change the default directory 464 * manually, define <code>WP_PLUGIN_DIR</code> and <code>WP_PLUGIN_URL</code> 465 * in wp-config.php. 466 * 467 * @access private 468 * @since 3.1.0 469 * @return array Files to include 470 */ 471 function wp_get_active_network_plugins() { 472 if ( ! is_multisite() ) 473 return array(); 474 475 $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); 476 if ( empty( $active_plugins ) ) 477 return array(); 478 479 $active_plugins = array_keys( $active_plugins ); 480 sort( $active_plugins ); 481 482 foreach ( $active_plugins as $plugin ) { 483 if ( ! validate_file( $plugin ) // $plugin must validate as file 484 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 485 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 486 ) 487 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 488 } 489 return $plugins; 490 } 491 492 /** 461 493 * Returns array of plugin files to be included in global scope. 462 494 * 463 495 * The default directory is wp-content/plugins. To change the default directory … … 472 504 $plugins = array(); 473 505 $active_plugins = (array) get_option( 'active_plugins', array() ); 474 506 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 507 // Check for hacks file if the option is enabled 485 508 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { 486 509 _deprecated_file( 'my-hacks.php', '1.5' ); … … 490 513 if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) ) 491 514 return $plugins; 492 515 516 $network_plugins = wp_get_active_network_plugins(); 517 493 518 foreach ( $active_plugins as $plugin ) { 494 519 if ( ! validate_file( $plugin ) // $plugin must validate as file 495 520 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 496 521 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 522 // not already included as a network plugin 523 && ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) 497 524 ) 498 525 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 499 526 } -
wp-settings.php
152 152 } 153 153 unset( $mu_plugin ); 154 154 155 foreach( wp_get_active_network_plugins() as $network_plugin ) { 156 include_once( $network_plugin ); 157 } 158 unset( $network_plugin ); 159 155 160 do_action( 'muplugins_loaded' ); 156 161 157 162 if ( is_multisite() )