Changeset 16011
- Timestamp:
- 10/27/2010 01:20:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin.php
r15754 r16011 465 465 */ 466 466 function activate_plugin( $plugin, $redirect = '', $network_wide = false) { 467 $plugin 467 $plugin = plugin_basename( trim( $plugin ) ); 468 468 469 469 if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) { … … 483 483 ob_start(); 484 484 include(WP_PLUGIN_DIR . '/' . $plugin); 485 do_action( 'activate_plugin', trim( $plugin));486 do_action( 'activate_' . trim( $plugin ));485 do_action( 'activate_plugin', $plugin, $network_wide ); 486 do_action( 'activate_' . $plugin, $network_wide ); 487 487 if ( $network_wide ) { 488 488 $current[$plugin] = time(); … … 493 493 update_option('active_plugins', $current); 494 494 } 495 do_action( 'activated_plugin', trim( $plugin));495 do_action( 'activated_plugin', $plugin, $network_wide ); 496 496 if ( ob_get_length() > 0 ) { 497 497 $output = ob_get_clean(); … … 522 522 523 523 foreach ( (array) $plugins as $plugin ) { 524 $plugin = plugin_basename( $plugin);524 $plugin = plugin_basename( trim( $plugin ) ); 525 525 if ( ! is_plugin_active($plugin) ) 526 526 continue; 527 528 $network_wide = is_plugin_active_for_network( $plugin ); 529 527 530 if ( ! $silent ) 528 do_action( 'deactivate_plugin', trim( $plugin ) ); 529 530 if ( is_plugin_active_for_network($plugin) ) { 531 // Deactivate network wide 531 do_action( 'deactivate_plugin', $plugin, $network_wide ); 532 533 if ( $network_wide ) { 532 534 $do_network = true; 533 535 unset( $network_current[ $plugin ] ); 534 536 } else { 535 // Deactivate for this blog only 536 $key = array_search( $plugin, (array) $current ); 537 $key = array_search( $plugin, $current ); 537 538 if ( false !== $key ) { 538 539 $do_blog = true; … … 541 542 } 542 543 543 //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.544 544 if ( ! $silent ) { 545 do_action( 'deactivate_' . trim( $plugin ));546 do_action( 'deactivated_plugin', trim( $plugin ));545 do_action( 'deactivate_' . $plugin, $network_wide ); 546 do_action( 'deactivated_plugin', $plugin, $network_wide ); 547 547 } 548 548 }
Note: See TracChangeset
for help on using the changeset viewer.