Ticket #17787: filters-and-minor-tweaks.patch
| File filters-and-minor-tweaks.patch, 5.5 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 /** 260 * @author 5ubliminal 261 */ 262 $plugin_files = apply_filters('get_plugins_files', $plugin_files); // [HACK] 258 263 259 264 foreach ( $plugin_files as $plugin_file ) { 260 265 if ( !is_readable( "$plugin_root/$plugin_file" ) ) … … 273 278 $cache_plugins[ $plugin_folder ] = $wp_plugins; 274 279 wp_cache_set('plugins', $cache_plugins, 'plugins'); 275 280 276 return $wp_plugins; 281 /** 282 * @author 5ubliminal 283 */ 284 return apply_filters('get_plugins', $wp_plugins); 277 285 } 278 286 279 287 /** -
wp-includes/load.php
455 455 closedir( $dh ); 456 456 sort( $mu_plugins ); 457 457 458 return $mu_plugins; 458 /** 459 * @author 5ubliminal 460 */ 461 return apply_filters('get_mu_plugins', $mu_plugins); 459 462 } 460 463 461 464 /** … … 484 487 485 488 $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; 486 489 490 /** 491 * @author 5ubliminal 492 */ 493 $active_plugins = apply_filters('active_and_valid_plugins', $plugins); 494 487 495 foreach ( $active_plugins as $plugin ) { 488 496 if ( ! validate_file( $plugin ) // $plugin must validate as file 489 497 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' … … 493 501 ) 494 502 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 495 503 } 496 return $plugins; 504 /** 505 * @author 5ubliminal 506 */ 507 return apply_filters('get_active_and_valid_plugins', $plugins); 497 508 } 498 509 499 510 /** -
wp-includes/ms-load.php
45 45 $active_plugins = array_keys( $active_plugins ); 46 46 sort( $active_plugins ); 47 47 48 /** 49 * @author 5ubliminal 50 */ 51 $active_plugins = apply_filters('active_network_plugins', $active_plugins); 52 48 53 foreach ( $active_plugins as $plugin ) { 49 54 if ( ! validate_file( $plugin ) // $plugin must validate as file 50 55 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' … … 52 57 ) 53 58 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 54 59 } 55 return $plugins; 60 61 /** 62 * @author 5ubliminal 63 */ 64 return apply_filters('get_active_network_plugins', $plugins); 56 65 } 57 66 58 67 /** -
wp-includes/plugin.php
65 65 function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) { 66 66 global $wp_filter, $merged_filters; 67 67 68 /** 69 * No longer violently unset($wp_filter); in wp-settings.php line #38-some. 70 * We empty this on first call or if we find it's not an array(). 71 * This function is the only one that should add data to it so it has every right to reset it on first run. 72 * 73 * And we count calls by using a static variable. 74 */ 75 static $hits = 0; 76 if(!$hits or !is_array($wp_filter)) $wp_filter = array(); // Reset filters on first run or on type mismatch 77 $hits++; // Increment hit count 78 68 79 $idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority); 69 80 $wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args); 70 81 unset( $merged_filters[ $tag ] ); -
wp-includes/theme.php
745 745 if ( empty( $templates ) ) 746 746 $templates = array("{$type}.php"); 747 747 748 /** 749 * Allow the use of one major filter named 'query_template'. 750 * Only if the returned value is an array() will it be used to replace previous array(). 751 * This is to prevent accidental returns of NULLs or such. 752 * @author 5ubliminal 753 */ 754 is_array( $new_templates = apply_filters( "query_template", $templates, $type ) ) and 755 !empty( $new_templates ) and ( $templates = $new_templates ); 756 748 757 return apply_filters( "{$type}_template", locate_template( $templates ) ); 749 758 } 750 759 -
wp-login.php
367 367 setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); 368 368 369 369 // allow plugins to override the default actions, and to add extra actions if they want 370 do_action( 'login_init' ); 370 /** 371 * We should also get the action name here. 372 * @author 5ubliminal 373 */ 374 do_action( 'login_init', $action ); 371 375 do_action( 'login_form_' . $action ); 372 376 373 377 $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); -
wp-settings.php
35 35 wp_unregister_GLOBALS(); 36 36 37 37 // Ensure these global variables do not exist so they do not interfere with WordPress. 38 unset( $wp_filter, $cache_lastcommentmodified ); 38 /** 39 * We now reset $wp_filter directly in the add_filter() function, 40 * the only function that should legally alter it. 41 * @author 5ubliminal 42 */ 43 unset($cache_lastcommentmodified); // unset( $wp_filter, $cache_lastcommentmodified ); 39 44 40 45 // Standardize $_SERVER variables across setups. 41 46 wp_fix_server_vars();