Ticket #11644: wpmu_sitewide_plugins.2.diff
| File wpmu_sitewide_plugins.2.diff, 3.4 KB (added by , 16 years ago) |
|---|
-
wp-admin/includes/plugin.php
259 259 * @return bool True, if in the active plugins list. False, not in the list. 260 260 */ 261 261 function is_plugin_active( $plugin ) { 262 return in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ));262 return in_array( $plugin, (array) get_option( 'active_plugins', array() ) || is_plugin_active_for_network( $plugin ); 263 263 } 264 264 265 265 /** … … 270 270 * @param string $plugin Base plugin path from plugins directory. 271 271 * @return bool True, if active for the network, otherwise false. 272 272 */ 273 function is_plugin_active_for_network( $plugin ) {273 function is_plugin_active_for_network( $plugin ) { 274 274 if ( !is_multisite() ) 275 275 return false; 276 276 … … 553 553 * @return array invalid plugins, plugin as key, error as value 554 554 */ 555 555 function validate_active_plugins() { 556 $plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array()) );556 $plugins = get_option( 'active_plugins', array() ); 557 557 // validate vartype: array 558 558 if ( ! is_array( $plugins ) ) { 559 559 update_option( 'active_plugins', array() ); … … 562 562 563 563 if ( is_multisite() && is_super_admin() ) { 564 564 $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); 565 $plugins = array_merge( (array)$plugins, $network_plugins );565 $plugins = array_merge( $plugins, $network_plugins ); 566 566 } 567 567 568 568 if ( empty( $plugins ) ) -
wp-admin/includes/upgrade.php
1074 1074 * @since 3.0.0 1075 1075 */ 1076 1076 function upgrade_network() { 1077 global $wp_current_db_version; 1077 1078 // 2.8 1078 1079 if ( $wp_current_db_version < 11549 ) { 1079 1080 $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' ); … … 1086 1087 1087 1088 update_site_option( 'active_sitewide_plugins', $sitewide_plugins ); 1088 1089 } 1089 update_site_option( 'wpmu_sitewide_plugins', '' );1090 update_site_option( 'deactivated_sitewide_plugins', '' );1090 delete_site_option( 'wpmu_sitewide_plugins' ); 1091 delete_site_option( 'deactivated_sitewide_plugins' ); 1091 1092 } 1092 1093 } 1093 1094 -
wp-includes/load.php
403 403 */ 404 404 function wp_load_plugins() { 405 405 $plugins = array(); 406 $active_plugins = (array) get_option( 'active_plugins', array() ); 406 407 407 // Check for hacks file if the option is enabled408 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) )409 $plugins[] = ABSPATH . 'my-hacks.php';410 411 $active_plugins = (array) apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );412 413 408 // Get active network plugins 414 409 if ( is_multisite() ) { 415 410 $active_sitewide_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); … … 419 414 } 420 415 } 421 416 417 // Check for hacks file if the option is enabled 418 if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { 419 _deprecated_file( 'my-hacks.php', '1.5' ); 420 array_unshift( $plugins, ABSPATH . 'my-hacks.php' ); 421 } 422 422 423 if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) ) 423 424 return $plugins; 424 425