Make WordPress Core


Ignore:
Timestamp:
03/16/2010 05:17:55 PM (15 years ago)
Author:
wpmuguru
Message:

first pass on optional global terms, see #12589

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/upgrade.php

    r13713 r13715  
    111111    $cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug'));
    112112
    113     if ( is_multisite() ) {
     113    if ( global_terms_enabled() ) {
    114114        $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
    115115        if ( $cat_id == null ) {
     
    131131    $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug'));
    132132
    133     if ( is_multisite() ) {
     133    if ( global_terms_enabled() ) {
    134134        $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
    135135        if ( $blogroll_id == null ) {
     
    19181918  KEY site_id (site_id)
    19191919) $charset_collate;
    1920 CREATE TABLE $wpdb->sitecategories (
    1921   cat_ID bigint(20) NOT NULL auto_increment,
    1922   cat_name varchar(55) NOT NULL default '',
    1923   category_nicename varchar(200) NOT NULL default '',
    1924   last_updated timestamp NOT NULL,
    1925   PRIMARY KEY  (cat_ID),
    1926   KEY category_nicename (category_nicename),
    1927   KEY last_updated (last_updated)
    1928 ) $charset_collate;
    19291920CREATE TABLE $wpdb->signups (
    19301921  domain varchar(200) NOT NULL default '',
     
    19461937}
    19471938endif;
     1939
     1940/**
     1941 * Install global terms.
     1942 *
     1943 * @since 3.0
     1944 *
     1945 */
     1946if ( !function_exists( 'install_global_terms' ) ) :
     1947function install_global_terms() {
     1948    global $wpdb, $charset_collate;
     1949    $ms_queries = "
     1950CREATE TABLE $wpdb->sitecategories (
     1951  cat_ID bigint(20) NOT NULL auto_increment,
     1952  cat_name varchar(55) NOT NULL default '',
     1953  category_nicename varchar(200) NOT NULL default '',
     1954  last_updated timestamp NOT NULL,
     1955  PRIMARY KEY  (cat_ID),
     1956  KEY category_nicename (category_nicename),
     1957  KEY last_updated (last_updated)
     1958) $charset_collate;
     1959";
     1960// now create tables
     1961    dbDelta( $ms_queries );
     1962}
     1963endif;
    19481964?>
Note: See TracChangeset for help on using the changeset viewer.