Ticket #15709: 15709.2.diff
| File 15709.2.diff, 2.6 KB (added by , 16 years ago) |
|---|
-
wp-admin/includes/plugin.php
455 455 } 456 456 457 457 /** 458 * Check whether the plugin is not network activated. 459 * 460 * Reverse of is_plugin_inactive_for_network(). Used as a callback. 461 * 462 * @since 3.1.0 463 * @see is_plugin_inactive_for_network() 464 * 465 * @param string $plugin Base plugin path from plugins directory. 466 * @return bool True if inactive. False if active. 467 */ 468 function is_plugin_inactive_for_network( $plugin ) { 469 return ! is_plugin_active_for_network( $plugin ); 470 } 471 472 /** 458 473 * Checks for "Network: true" in the plugin header to see if this should 459 474 * be activated only as a network wide plugin. The plugin would also work 460 475 * when Multisite is not enabled. … … 735 750 * @return array invalid plugins, plugin as key, error as value 736 751 */ 737 752 function validate_active_plugins() { 738 $plugins = get_option( 'active_plugins', array() ); 739 // validate vartype: array 740 if ( ! is_array( $plugins ) ) { 741 update_option( 'active_plugins', array() ); 742 $plugins = array(); 753 if ( !is_network_admin() ) { 754 $plugins = get_option( 'active_plugins', array() ); 755 // validate vartype: array 756 if ( ! is_array( $plugins ) ) { 757 update_option( 'active_plugins', array() ); 758 $plugins = array(); 759 } 760 } else { 761 $plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) ); 743 762 } 744 763 745 if ( is_multisite() && is_super_admin() ) {746 $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );747 $plugins = array_merge( $plugins, array_keys( $network_plugins ) );748 }749 750 764 if ( empty( $plugins ) ) 751 765 return; 752 766 -
wp-admin/plugins.php
195 195 196 196 //$_POST = from the plugin form; $_GET = from the FTP details screen. 197 197 $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 198 $plugins = array_filter($plugins, 'is_plugin_inactive'); // Do not allow to delete Activated plugins. 198 199 if ( ! is_network_admin() ) 200 $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete Activated plugins. 201 else 202 $plugins = array_filter( $plugins, 'is_plugin_inactive_for_network' ); // Do not allow to delete Network Activated plugins. 203 199 204 if ( empty($plugins) ) { 200 205 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ); 201 206 exit;
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)