Ticket #36819: 36819.diff
File 36819.diff, 2.7 KB (added by , 9 years ago) |
---|
-
src/wp-settings.php
20 20 // Include files required for initialization. 21 21 require( ABSPATH . WPINC . '/load.php' ); 22 22 require( ABSPATH . WPINC . '/default-constants.php' ); 23 require( ABSPATH . WPINC . '/plugin.php' ); 23 24 24 25 /* 25 26 * These can't be directly globalized in version.php. When updating, … … 70 71 wp_debug_mode(); 71 72 72 73 // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. 73 if ( WP_CACHE ) 74 if ( WP_CACHE ) { 75 _backup_plugin_globals(); 74 76 WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); 77 _restore_plugin_globals(); 78 } 75 79 76 80 // Define WP_LANG_DIR if not set. 77 81 wp_set_lang_dir(); … … 81 85 require( ABSPATH . WPINC . '/functions.php' ); 82 86 require( ABSPATH . WPINC . '/class-wp.php' ); 83 87 require( ABSPATH . WPINC . '/class-wp-error.php' ); 84 require( ABSPATH . WPINC . '/plugin.php' );85 88 require( ABSPATH . WPINC . '/pomo/mo.php' ); 86 89 87 90 // Include the wpdb class and, if present, a db.php database drop-in. -
src/wp-includes/plugin.php
946 946 return $function[0] . '::' . $function[1]; 947 947 } 948 948 } 949 950 function _backup_plugin_globals(){ 951 global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter; 952 static $backup_globals = array(); 953 if ( empty( $backup_globals ) ) { 954 $backup_globals = array( 955 'backup_wp_filter' => $wp_filter, 956 'backup_wp_actions' => $wp_actions, 957 'backup_merged_filters' => $merged_filters, 958 'backup_wp_current_filter' => $wp_current_filter, 959 ); 960 }; 961 return $backup_globals; 962 } 963 964 function _restore_plugin_globals(){ 965 global $wp_filter, $wp_actions, $merged_filters, $wp_current_filter; 966 $backup_globals = _backup_plugin_globals(); 967 if ( $wp_filter !== $backup_globals['backup_wp_filter'] ){ 968 $wp_filter = array_merge_recursive( $wp_filter, $backup_globals['backup_wp_filter'] ); 969 } 970 971 if ( $wp_actions !== $backup_globals['backup_wp_actions'] ){ 972 $wp_actions = array_merge_recursive( $wp_actions, $backup_globals['backup_wp_actions'] ); 973 } 974 975 if ( $merged_filters !== $backup_globals['backup_merged_filters'] ){ 976 $merged_filters = array_merge_recursive( $merged_filters, $backup_globals['backup_merged_filters'] ); 977 } 978 979 if ( $wp_current_filter !== $backup_globals['backup_wp_current_filter'] ){ 980 $wp_current_filter = array_merge_recursive( $wp_current_filter, $backup_globals['backup_wp_current_filter'] ); 981 } 982 }