Changeset 38636
- Timestamp:
- 09/20/2016 09:38:08 PM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r38632 r38636 4310 4310 * @since 3.0.0 4311 4311 * 4312 * @global object $current_site 4313 * 4312 4314 * @param int $site_id Optional. Site ID to test. Defaults to current site. 4313 4315 * @return bool True if $site_id is the main site of the network, or if not … … 4315 4317 */ 4316 4318 function is_main_site( $site_id = null ) { 4317 if ( ! is_multisite() ) { 4319 // This is the current network's information; 'site' is old terminology. 4320 global $current_site; 4321 4322 if ( ! is_multisite() ) 4318 4323 return true; 4319 } 4320 4321 if ( ! $site_id ) { 4324 4325 if ( ! $site_id ) 4322 4326 $site_id = get_current_blog_id(); 4323 } 4324 return (int) $site_id === (int) get_current_site()->blog_id;4327 4328 return (int) $site_id === (int) $current_site->blog_id; 4325 4329 } 4326 4330 -
trunk/src/wp-includes/link-template.php
r38611 r38636 3258 3258 $current_site = get_current_site(); 3259 3259 3260 if ( 'relative' == $scheme ) {3260 if ( 'relative' == $scheme ) 3261 3261 $url = $current_site->path; 3262 } else {3262 else 3263 3263 $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme ); 3264 } 3265 3266 if ( $path && is_string( $path ) ) { 3264 3265 if ( $path && is_string( $path ) ) 3267 3266 $url .= ltrim( $path, '/' ); 3268 }3269 3267 3270 3268 /** … … 3306 3304 $scheme = is_ssl() && ! is_admin() ? 'https' : 'http'; 3307 3305 3308 if ( 'relative' == $scheme ) {3306 if ( 'relative' == $scheme ) 3309 3307 $url = $current_site->path; 3310 } else {3308 else 3311 3309 $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme ); 3312 } 3313 3314 if ( $path && is_string( $path ) ) { 3310 3311 if ( $path && is_string( $path ) ) 3315 3312 $url .= ltrim( $path, '/' ); 3316 }3317 3313 3318 3314 /** -
trunk/src/wp-includes/load.php
r38607 r38636 1069 1069 return ( $thing instanceof WP_Error ); 1070 1070 } 1071 1072 /**1073 * Get the current network.1074 *1075 * Returns an object containing the 'id', 'domain', 'path', and 'site_name'1076 * properties of the network being viewed.1077 *1078 * @see wpmu_current_site()1079 *1080 * @since MU1081 *1082 * @global WP_Network $current_site1083 *1084 * @return WP_Network1085 */1086 function get_current_site() {1087 global $current_site;1088 return $current_site;1089 } -
trunk/src/wp-includes/ms-blogs.php
r38596 r38636 1089 1089 * @since 4.6.0 1090 1090 * 1091 * @global WP_Network $current_site 1092 * 1091 1093 * @param WP_Network|int|null $network Optional. Network to retrieve. Default is the current network. 1092 1094 * @return WP_Network|null The network object or null if not found. 1093 1095 */ 1094 1096 function get_network( $network = null ) { 1095 $current_site = get_current_site();1097 global $current_site; 1096 1098 if ( empty( $network ) && isset( $current_site ) ) { 1097 1099 $network = $current_site; -
trunk/src/wp-includes/ms-functions.php
r38457 r38636 1333 1333 */ 1334 1334 function install_blog( $blog_id, $blog_title = '' ) { 1335 global $wpdb, $wp_roles; 1335 global $wpdb, $wp_roles, $current_site; 1336 1336 1337 // Cast for security 1337 1338 $blog_id = (int) $blog_id; … … 1361 1362 $siteurl = set_url_scheme( $siteurl, 'https' ); 1362 1363 } 1363 if ( 'https' === parse_url( get_home_url( get_current_site()->blog_id ), PHP_URL_SCHEME ) ) {1364 if ( 'https' === parse_url( get_home_url( $current_site->blog_id ), PHP_URL_SCHEME ) ) { 1364 1365 $home = set_url_scheme( $home, 'https' ); 1365 1366 } … … 1498 1499 $message = $welcome_email; 1499 1500 1500 if ( empty( $current_site->site_name ) ) {1501 if ( empty( $current_site->site_name ) ) 1501 1502 $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 MU 1603 * 1604 * @global WP_Network $current_site 1605 * 1606 * @return WP_Network 1607 */ 1608 function get_current_site() { 1609 global $current_site; 1610 return $current_site; 1592 1611 } 1593 1612 -
trunk/src/wp-includes/option.php
r38388 r38636 1071 1071 * 1072 1072 * @global wpdb $wpdb 1073 * @global object $current_site 1073 1074 * 1074 1075 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1078 1079 */ 1079 1080 function get_network_option( $network_id, $option, $default = false ) { 1080 global $wpdb ;1081 global $wpdb, $current_site; 1081 1082 1082 1083 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1088 1089 // Fallback to the current network if a network ID is not specified. 1089 1090 if ( ! $network_id && is_multisite() ) { 1090 $network_id = get_current_site()->id;1091 $network_id = $current_site->id; 1091 1092 } 1092 1093 … … 1187 1188 * 1188 1189 * @global wpdb $wpdb 1190 * @global object $current_site 1189 1191 * 1190 1192 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1194 1196 */ 1195 1197 function add_network_option( $network_id, $option, $value ) { 1196 global $wpdb ;1198 global $wpdb, $current_site; 1197 1199 1198 1200 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1204 1206 // Fallback to the current network if a network ID is not specified. 1205 1207 if ( ! $network_id && is_multisite() ) { 1206 $network_id = get_current_site()->id;1208 $network_id = $current_site->id; 1207 1209 } 1208 1210 … … 1296 1298 * 1297 1299 * @global wpdb $wpdb 1300 * @global object $current_site 1298 1301 * 1299 1302 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1302 1305 */ 1303 1306 function delete_network_option( $network_id, $option ) { 1304 global $wpdb ;1307 global $wpdb, $current_site; 1305 1308 1306 1309 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1312 1315 // Fallback to the current network if a network ID is not specified. 1313 1316 if ( ! $network_id && is_multisite() ) { 1314 $network_id = get_current_site()->id;1317 $network_id = $current_site->id; 1315 1318 } 1316 1319 … … 1377 1380 * 1378 1381 * @global wpdb $wpdb 1382 * @global object $current_site 1379 1383 * 1380 1384 * @param int $network_id ID of the network. Can be null to default to the current network ID. … … 1384 1388 */ 1385 1389 function update_network_option( $network_id, $option, $value ) { 1386 global $wpdb ;1390 global $wpdb, $current_site; 1387 1391 1388 1392 if ( $network_id && ! is_numeric( $network_id ) ) { … … 1394 1398 // Fallback to the current network if a network ID is not specified. 1395 1399 if ( ! $network_id && is_multisite() ) { 1396 $network_id = get_current_site()->id;1400 $network_id = $current_site->id; 1397 1401 } 1398 1402
Note: See TracChangeset
for help on using the changeset viewer.