Changeset 37620
- Timestamp:
- 06/02/2016 02:25:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r37618 r37620 297 297 * 298 298 * @since MU 2.6.5 299 * @since 4.6.0 Converted to use get_sites() 299 300 * 300 301 * @global wpdb $wpdb WordPress database abstraction object. … … 305 306 */ 306 307 function get_blog_id_from_url( $domain, $path = '/' ) { 307 global $wpdb;308 309 308 $domain = strtolower( $domain ); 310 309 $path = strtolower( $path ); … … 316 315 return (int) $id; 317 316 318 $id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s and path = %s /* get_blog_id_from_url */", $domain, $path ) ); 317 $args = array( 318 'domain' => $domain, 319 'path' => $path, 320 'fields' => 'ids', 321 ); 322 $result = get_sites( $args ); 323 $id = array_shift( $result ); 319 324 320 325 if ( ! $id ) { … … 1248 1253 * 1249 1254 * @since MU 1255 * @since 4.6.0 Converted to use get_sites() 1250 1256 * 1251 1257 * @global wpdb $wpdb WordPress database abstraction object. … … 1257 1263 */ 1258 1264 function domain_exists($domain, $path, $site_id = 1) { 1259 global $wpdb;1260 1265 $path = trailingslashit( $path ); 1261 $result = $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) ); 1266 $args = array( 1267 'network_id' => $site_id, 1268 'domain' => $domain, 1269 'path' => $path, 1270 'fields' => 'ids', 1271 ); 1272 $result = get_sites( $args ); 1273 $result = array_shift( $result ); 1262 1274 1263 1275 /** … … 2248 2260 * 2249 2261 * @since 3.7.0 2262 * @since 4.6.0 Converted to use get_sites() 2250 2263 * 2251 2264 * @global wpdb $wpdb WordPress database abstraction object. … … 2254 2267 global $wpdb; 2255 2268 2256 $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) ); 2269 $count = get_sites( array( 2270 'network_id' => $wpdb->siteid, 2271 'spam' => 0, 2272 'deleted' => 0, 2273 'archived' => 0, 2274 'count' => true, 2275 ) ); 2276 2257 2277 update_site_option( 'blog_count', $count ); 2258 2278 }
Note: See TracChangeset
for help on using the changeset viewer.