Changeset 13715
- Timestamp:
- 03/16/2010 05:17:55 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-link-categories.php
r12818 r13715 201 201 <input name="name" id="name" type="text" value="" size="40" aria-required="true" /> 202 202 </div> 203 <?php if ( ! is_multisite() ) { ?>203 <?php if ( !global_terms_enabled() ) { ?> 204 204 <div class="form-field"> 205 205 <label for="slug"><?php _e('Link Category slug') ?></label> -
trunk/wp-admin/edit-tag-form.php
r13162 r13715 38 38 <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td> 39 39 </tr> 40 <?php if ( ! is_multisite() ) { ?>40 <?php if ( !global_terms_enabled() ) { ?> 41 41 <tr class="form-field"> 42 42 <th scope="row" valign="top"><label for="slug"><?php echo _x('Slug', 'Taxonomy Slug'); ?></label></th> -
trunk/wp-admin/includes/ms.php
r13618 r13715 521 521 522 522 function sync_category_tag_slugs( $term, $taxonomy ) { 523 if ( $taxonomy == 'category' || $taxonomy == 'post_tag') {523 if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) { 524 524 if ( is_object( $term ) ) { 525 525 $term->slug = sanitize_title( $term->name ); -
trunk/wp-admin/includes/schema.php
r13713 r13715 660 660 661 661 if ( !is_multisite() ) { 662 663 $wpdb->query( "INSERT INTO $wpdb->sitecategories (cat_id, cat_name, category_nicename, last_updated) SELECT term_id, `name`, slug, NOW() FROM $wpdb->terms" );664 665 662 $site_admins = array( $site_user->user_login ); 666 663 $users = get_users_of_blog(); … … 709 706 'upload_space_check_disabled' => '0', 710 707 'subdomain_install' => intval( $subdomain_install ), 708 'global_terms_enabled' => global_terms_enabled() ? '1' : '0' 711 709 ); 712 if ( is_multisite() )713 $sitemeta[ 'global_terms_enabled' ] = get_site_option( 'global_terms_enabled', '0' );714 else715 $sitemeta[ 'global_terms_enabled' ] = '0';716 710 717 711 $insert = ''; -
trunk/wp-admin/includes/upgrade.php
r13713 r13715 111 111 $cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug')); 112 112 113 if ( is_multisite() ) {113 if ( global_terms_enabled() ) { 114 114 $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); 115 115 if ( $cat_id == null ) { … … 131 131 $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug')); 132 132 133 if ( is_multisite() ) {133 if ( global_terms_enabled() ) { 134 134 $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); 135 135 if ( $blogroll_id == null ) { … … 1918 1918 KEY site_id (site_id) 1919 1919 ) $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;1929 1920 CREATE TABLE $wpdb->signups ( 1930 1921 domain varchar(200) NOT NULL default '', … … 1946 1937 } 1947 1938 endif; 1939 1940 /** 1941 * Install global terms. 1942 * 1943 * @since 3.0 1944 * 1945 */ 1946 if ( !function_exists( 'install_global_terms' ) ) : 1947 function install_global_terms() { 1948 global $wpdb, $charset_collate; 1949 $ms_queries = " 1950 CREATE 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 } 1963 endif; 1948 1964 ?> -
trunk/wp-admin/ms-edit.php
r13713 r13715 108 108 } 109 109 update_site_option( "dashboard_blog", $dashboard_blog_id ); 110 // global terms 111 if ( !global_terms_enabled() && '1' == $_POST[ 'global_terms_enabled' ] ) { 112 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 113 // create global terms table 114 install_global_terms(); 115 } 110 116 $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'admin_notice_feed', 'global_terms_enabled' ); 111 117 $checked_options = array('mu_media_buttons', 'menu_items'); -
trunk/wp-includes/functions.php
r13677 r13715 448 448 $site_id = $wpdb->siteid; 449 449 450 $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'dashboard_blog', 'can_compress_scripts' );450 $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'dashboard_blog', 'can_compress_scripts', 'global_terms_enabled' ); 451 451 452 452 $core_options_in = "'" . implode("', '", $core_options) . "'"; … … 3692 3692 3693 3693 /** 3694 * are global terms enabled 3695 * 3696 * 3697 * @since 3.0.0 3698 * @package WordPress 3699 * 3700 * @return bool True if multisite and global terms enabled 3701 */ 3702 function global_terms_enabled() { 3703 if ( is_multisite() && '1' == get_site_option( 'global_terms_enabled' ) ) 3704 return true; 3705 3706 return false; 3707 } 3708 3709 /** 3694 3710 * gmt_offset modification for smart timezone handling 3695 3711 * -
trunk/wp-includes/ms-functions.php
r13563 r13715 1211 1211 global $wpdb; 1212 1212 1213 if ( !global_terms_enabled() ) 1214 return $term_id; 1215 1213 1216 $term_id = intval( $term_id ); 1214 1217 $c = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %d", $term_id ) );
Note: See TracChangeset
for help on using the changeset viewer.