Changeset 38388
- Timestamp:
- 08/26/2016 09:34:36 PM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r38386 r38388 4276 4276 * @since 3.0.0 4277 4277 * 4278 * @global object $current_site4279 *4280 4278 * @param int $site_id Optional. Site ID to test. Defaults to current site. 4281 4279 * @return bool True if $site_id is the main site of the network, or if not … … 4283 4281 */ 4284 4282 function is_main_site( $site_id = null ) { 4285 // This is the current network's information; 'site' is old terminology. 4286 global $current_site; 4287 4288 if ( ! is_multisite() ) 4283 if ( ! is_multisite() ) { 4289 4284 return true; 4290 4291 if ( ! $site_id ) 4285 } 4286 4287 if ( ! $site_id ) { 4292 4288 $site_id = get_current_blog_id(); 4293 4294 return (int) $site_id === (int) $current_site->blog_id;4289 } 4290 return (int) $site_id === (int) get_current_site()->blog_id; 4295 4291 } 4296 4292 -
trunk/src/wp-includes/link-template.php
r38369 r38388 3264 3264 $current_site = get_current_site(); 3265 3265 3266 if ( 'relative' == $scheme ) 3266 if ( 'relative' == $scheme ) { 3267 3267 $url = $current_site->path; 3268 else3268 } else { 3269 3269 $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme ); 3270 3271 if ( $path && is_string( $path ) ) 3270 } 3271 3272 if ( $path && is_string( $path ) ) { 3272 3273 $url .= ltrim( $path, '/' ); 3274 } 3273 3275 3274 3276 /** … … 3310 3312 $scheme = is_ssl() && ! is_admin() ? 'https' : 'http'; 3311 3313 3312 if ( 'relative' == $scheme ) 3314 if ( 'relative' == $scheme ) { 3313 3315 $url = $current_site->path; 3314 else3316 } else { 3315 3317 $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme ); 3316 3317 if ( $path && is_string( $path ) ) 3318 } 3319 3320 if ( $path && is_string( $path ) ) { 3318 3321 $url .= ltrim( $path, '/' ); 3322 } 3319 3323 3320 3324 /** -
trunk/src/wp-includes/load.php
r38363 r38388 1060 1060 return ( $thing instanceof WP_Error ); 1061 1061 } 1062 1063 /** 1064 * Get the current network. 1065 * 1066 * Returns an object containing the 'id', 'domain', 'path', and 'site_name' 1067 * properties of the network being viewed. 1068 * 1069 * @see wpmu_current_site() 1070 * 1071 * @since MU 1072 * 1073 * @global WP_Network $current_site 1074 * 1075 * @return WP_Network 1076 */ 1077 function get_current_site() { 1078 global $current_site; 1079 return $current_site; 1080 } -
trunk/src/wp-includes/ms-blogs.php
r38232 r38388 1084 1084 * @since 4.6.0 1085 1085 * 1086 * @global WP_Network $current_site1087 *1088 1086 * @param WP_Network|int|null $network Optional. Network to retrieve. Default is the current network. 1089 1087 * @return WP_Network|null The network object or null if not found. 1090 1088 */ 1091 1089 function get_network( $network = null ) { 1092 global $current_site;1090 $current_site = get_current_site(); 1093 1091 if ( empty( $network ) && isset( $current_site ) ) { 1094 1092 $network = $current_site; -
trunk/src/wp-includes/ms-functions.php
r38201 r38388 1333 1333 */ 1334 1334 function install_blog( $blog_id, $blog_title = '' ) { 1335 global $wpdb, $wp_roles, $current_site; 1336 1335 global $wpdb, $wp_roles; 1337 1336 // Cast for security 1338 1337 $blog_id = (int) $blog_id; … … 1362 1361 $siteurl = set_url_scheme( $siteurl, 'https' ); 1363 1362 } 1364 if ( 'https' === parse_url( get_home_url( $current_site->blog_id ), PHP_URL_SCHEME ) ) {1363 if ( 'https' === parse_url( get_home_url( get_current_site()->blog_id ), PHP_URL_SCHEME ) ) { 1365 1364 $home = set_url_scheme( $home, 'https' ); 1366 1365 } … … 1499 1498 $message = $welcome_email; 1500 1499 1501 if ( empty( $current_site->site_name ) ) 1500 if ( empty( $current_site->site_name ) ) { 1502 1501 $current_site->site_name = 'WordPress'; 1502 } 1503 1503 1504 1504 /** … … 1590 1590 wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); 1591 1591 return true; 1592 }1593 1594 /**1595 * Get the current network.1596 *1597 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'1598 * properties of the network being viewed.1599 *1600 * @see wpmu_current_site()1601 *1602 * @since MU1603 *1604 * @global WP_Network $current_site1605 *1606 * @return WP_Network1607 */1608 function get_current_site() {1609 global $current_site;1610 return $current_site;1611 1592 } 1612 1593 -
trunk/src/wp-includes/option.php
r38334 r38388 1071 1071 * 1072 1072 * @global wpdb $wpdb 1073 * @global object $current_site1074 1073 * 1075 1074 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1079 1078 */ 1080 1079 function get_network_option( $network_id, $option, $default = false ) { 1081 global $wpdb , $current_site;1080 global $wpdb; 1082 1081 1083 1082 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1089 1088 // Fallback to the current network if a network ID is not specified. 1090 1089 if ( ! $network_id && is_multisite() ) { 1091 $network_id = $current_site->id;1090 $network_id = get_current_site()->id; 1092 1091 } 1093 1092 … … 1188 1187 * 1189 1188 * @global wpdb $wpdb 1190 * @global object $current_site1191 1189 * 1192 1190 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1196 1194 */ 1197 1195 function add_network_option( $network_id, $option, $value ) { 1198 global $wpdb , $current_site;1196 global $wpdb; 1199 1197 1200 1198 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1206 1204 // Fallback to the current network if a network ID is not specified. 1207 1205 if ( ! $network_id && is_multisite() ) { 1208 $network_id = $current_site->id;1206 $network_id = get_current_site()->id; 1209 1207 } 1210 1208 … … 1298 1296 * 1299 1297 * @global wpdb $wpdb 1300 * @global object $current_site1301 1298 * 1302 1299 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1305 1302 */ 1306 1303 function delete_network_option( $network_id, $option ) { 1307 global $wpdb , $current_site;1304 global $wpdb; 1308 1305 1309 1306 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1315 1312 // Fallback to the current network if a network ID is not specified. 1316 1313 if ( ! $network_id && is_multisite() ) { 1317 $network_id = $current_site->id;1314 $network_id = get_current_site()->id; 1318 1315 } 1319 1316 … … 1380 1377 * 1381 1378 * @global wpdb $wpdb 1382 * @global object $current_site1383 1379 * 1384 1380 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1388 1384 */ 1389 1385 function update_network_option( $network_id, $option, $value ) { 1390 global $wpdb , $current_site;1386 global $wpdb; 1391 1387 1392 1388 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1398 1394 // Fallback to the current network if a network ID is not specified. 1399 1395 if ( ! $network_id && is_multisite() ) { 1400 $network_id = $current_site->id;1396 $network_id = get_current_site()->id; 1401 1397 } 1402 1398
Note: See TracChangeset
for help on using the changeset viewer.