Changeset 13644
- Timestamp:
- 03/10/2010 08:46:05 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r13642 r13644 16 16 if ( ! is_super_admin() ) 17 17 wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); 18 19 include( ABSPATH . 'wp-admin/includes/network.php' );20 18 21 19 // We need to create references to ms global tables to enable Network. 22 20 foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) 23 21 $wpdb->$table = $prefixed_table; 22 23 /** 24 * Check for existing network data/tables. 25 * 26 * @since 3.0.0 27 */ 28 function network_domain_check() { 29 global $wpdb; 30 if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ) 31 return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" ); 32 return false; 33 } 34 35 /** 36 * Get base domain of network. 37 * 38 * @since 3.0.0 39 */ 40 function get_clean_basedomain() { 41 global $wpdb; 42 $existing_domain = network_domain_check(); 43 if ( $existing_domain ) 44 return $existing_domain; 45 $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); 46 if ( strpos( $domain, '/' ) ) 47 $domain = substr( $domain, 0, strpos( $domain, '/' ) ); 48 return $domain; 49 } 24 50 25 51 if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) )
Note: See TracChangeset
for help on using the changeset viewer.