Ticket #33900: 33900.3.patch
File 33900.3.patch, 2.6 KB (added by , 9 years ago) |
---|
-
src/wp-includes/functions.php
4220 4220 * 4221 4221 * @since 4.3.0 4222 4222 * 4223 * @global wpdb $wpdb WordPress database abstraction object. 4223 * @global wpdb $wpdb WordPress database abstraction object. 4224 * @global object $current_site 4224 4225 * 4225 4226 * @return int The ID of the main network. 4226 4227 */ 4227 4228 function get_main_network_id() { 4228 global $wpdb ;4229 global $wpdb, $current_site; 4229 4230 4230 4231 if ( ! is_multisite() ) { 4231 4232 return 1; … … 4233 4234 4234 4235 if ( defined( 'PRIMARY_NETWORK_ID' ) ) { 4235 4236 $main_network_id = PRIMARY_NETWORK_ID; 4236 } elseif ( 1 === (int) get_current_site()->id ) {4237 } elseif ( $current_site instanceof WP_Network && 1 === (int) $current_site->id ) { 4237 4238 // If the current network has an ID of 1, assume it is the main network. 4238 4239 $main_network_id = 1; 4239 4240 } else { -
src/wp-includes/load.php
183 183 // If the $upgrading timestamp is older than 10 minutes, don't die. 184 184 if ( ( time() - $upgrading ) >= 600 ) 185 185 return; 186 186 187 187 /** 188 188 * Bypass the maintenance mode check 189 189 * 190 190 * This filter should *NOT* be used by plugins. It is designed for non-web 191 * runtimes. If this filter returns true, maintenance mode will not be 191 * runtimes. If this filter returns true, maintenance mode will not be 192 192 * active which can cause problems during updates for web site views. 193 193 * 194 194 * @since 4.6.0 … … 196 196 * @param bool True to bypass maintenance 197 197 */ 198 198 if ( apply_filters( 'bypass_maintenance_mode', false ) ){ 199 return; 199 return; 200 200 } 201 201 202 202 if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { … … 310 310 * 311 311 * @since 4.6.0 312 312 * 313 * @param bool True to bypass debug mode 313 * @param bool True to bypass debug mode 314 314 */ 315 315 if ( apply_filters( 'bypass_debug_mode', false ) ){ 316 return; 316 return; 317 317 } 318 318 319 319 if ( WP_DEBUG ) { … … 808 808 } 809 809 810 810 /** 811 * Retrieve the current network ID. 812 * 813 * @since 4.6.0 814 * 815 * @global object $current_site 816 * 817 * @return int Network id 818 */ 819 function get_current_network_id() { 820 global $current_site; 821 822 if ( ! is_multisite() ) { 823 return 1; 824 } 825 826 if ( ! $current_site instanceof WP_Network ) { 827 return get_main_network_id(); 828 } 829 830 return absint( $current_site->id ); 831 } 832 833 /** 811 834 * Attempt an early load of translations. 812 835 * 813 836 * Used for errors encountered during the initial loading process, before