Make WordPress Core

Changeset 13644


Ignore:
Timestamp:
03/10/2010 08:46:05 AM (15 years ago)
Author:
nacin
Message:

Remove unused MU function and unnecessary separate includes file. see #11816

Location:
trunk/wp-admin
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network.php

    r13642 r13644  
    1616if ( ! is_super_admin() )
    1717    wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
    18 
    19 include( ABSPATH . 'wp-admin/includes/network.php' );
    2018
    2119// We need to create references to ms global tables to enable Network.
    2220foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table )
    2321    $wpdb->$table = $prefixed_table;
     22
     23/**
     24 * Check for existing network data/tables.
     25 *
     26 * @since 3.0.0
     27 */
     28function 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 */
     40function 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}
    2450
    2551if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) )
Note: See TracChangeset for help on using the changeset viewer.