Ticket #22803: 22803.2.diff
| File 22803.2.diff, 1.2 KB (added by , 13 years ago) |
|---|
-
wp-includes/capabilities.php
function current_user_can( $capability ) { 1299 1299 * @return bool 1300 1300 */ 1301 1301 function current_user_can_for_blog( $blog_id, $capability ) { 1302 switch_to_blog( $blog_id ); 1302 if ( is_multisite() ) 1303 switch_to_blog( $blog_id ); 1303 1304 1304 1305 $current_user = wp_get_current_user(); 1305 1306 … … function current_user_can_for_blog( $blog_id, $capability ) { 1311 1312 1312 1313 $can = call_user_func_array( array( $current_user, 'has_cap' ), $args ); 1313 1314 1314 restore_current_blog(); 1315 if ( is_multisite() ) 1316 restore_current_blog(); 1315 1317 1316 1318 return $can; 1317 1319 } -
wp-includes/class-wp-theme.php
final class WP_Theme implements ArrayAccess { 1104 1104 public static function get_allowed_on_site( $blog_id = null ) { 1105 1105 static $allowed_themes = array(); 1106 1106 1107 if ( ! $blog_id )1107 if ( ! $blog_id || ! is_multisite() ) 1108 1108 $blog_id = get_current_blog_id(); 1109 1109 1110 1110 if ( isset( $allowed_themes[ $blog_id ] ) )