Ticket #17787: plugins-filters.2.patch
| File plugins-filters.2.patch, 3.4 KB (added by , 15 years ago) |
|---|
-
wp-admin/includes/plugin.php
255 255 256 256 if ( empty($plugin_files) ) 257 257 return $wp_plugins; 258 259 // filter these with a function name similar filter 260 $plugin_files = apply_filters('get_plugins_files', $plugin_files); // [HACK] 258 261 259 262 foreach ( $plugin_files as $plugin_file ) { 260 263 if ( !is_readable( "$plugin_root/$plugin_file" ) ) … … 273 276 $cache_plugins[ $plugin_folder ] = $wp_plugins; 274 277 wp_cache_set('plugins', $cache_plugins, 'plugins'); 275 278 276 return $wp_plugins; 279 // filter these with a function name similar filter 280 return apply_filters('get_plugins', $wp_plugins); 277 281 } 278 282 279 283 /** -
wp-includes/load.php
455 455 closedir( $dh ); 456 456 sort( $mu_plugins ); 457 457 458 return $mu_plugins; 458 // filter these with a function name similar filter 459 return apply_filters('get_mu_plugins', $mu_plugins); 459 460 } 460 461 461 462 /** … … 484 485 485 486 $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; 486 487 488 // filter these with a function name similar filter 489 $active_plugins = apply_filters('active_and_valid_plugins', $plugins); 490 487 491 foreach ( $active_plugins as $plugin ) { 488 492 if ( ! validate_file( $plugin ) // $plugin must validate as file 489 493 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' … … 493 497 ) 494 498 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 495 499 } 496 return $plugins; 500 501 // filter these with a function name similar filter 502 return apply_filters('get_active_and_valid_plugins', $plugins); 497 503 } 498 504 499 505 /** -
wp-includes/ms-load.php
45 45 $active_plugins = array_keys( $active_plugins ); 46 46 sort( $active_plugins ); 47 47 48 // filter these with a function name similar filter 49 $active_plugins = apply_filters('active_network_plugins', $active_plugins); 50 48 51 foreach ( $active_plugins as $plugin ) { 49 52 if ( ! validate_file( $plugin ) // $plugin must validate as file 50 53 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' … … 52 55 ) 53 56 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 54 57 } 55 return $plugins; 58 59 // filter these with a function name similar filter 60 return apply_filters('get_active_network_plugins', $plugins); 56 61 } 57 62 58 63 /** -
wp-settings.php
149 149 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. 150 150 wp_plugin_directory_constants( ); 151 151 152 // Attempt to load wp-plugins.php from ABSPATH or ABSPATH's parent. 153 // This allows those who manage WordPress to tweak MU plugins before loaded. 154 // Combining this with wp-config.php outisde ABSPATH, a multi instance 155 // WordPress environment can be created. 156 if(is_file(ABSPATH.'/wp-plugins.php')) require_once(ABSPATH.'/wp-plugins.php'); 157 else if(is_file(ABSPATH.'/../wp-plugins.php')) require_once(ABSPATH.'/../wp-plugins.php'); 158 152 159 // Load must-use plugins. 153 160 foreach ( wp_get_mu_plugins() as $mu_plugin ) { 154 161 include_once( $mu_plugin );