diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php
index 9b2110398c..494c15547b 100644
--- a/wp-admin/edit-tag-form.php
+++ b/wp-admin/edit-tag-form.php
@@ -148,7 +148,6 @@ if ( isset( $tag->name ) ) {
labels->name_field_description; ?>
-
name ) ) {
labels->slug_field_description; ?>
-
labels->parent_item ); ?>
diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php
index abbc330b82..9812d97c76 100644
--- a/wp-admin/edit-tags.php
+++ b/wp-admin/edit-tags.php
@@ -280,9 +280,7 @@ if ( 'category' === $taxonomy || 'link_category' === $taxonomy || 'post_tag' ===
$help .= '' .
'' . __( 'Name — The name is how it appears on your site.' ) . ' ';
- if ( ! global_terms_enabled() ) {
- $help .= '' . __( 'Slug — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . ' ';
- }
+ $help .= '' . __( 'Slug — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . ' ';
if ( 'category' === $taxonomy ) {
$help .= '' . __( 'Parent — Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . ' ';
@@ -456,13 +454,11 @@ if ( $can_edit_terms ) {
labels->name_field_description; ?>
-
-
labels->parent_item ); ?>
diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php
index bae5a11b1f..c43ec62689 100644
--- a/wp-admin/includes/class-wp-terms-list-table.php
+++ b/wp-admin/includes/class-wp-terms-list-table.php
@@ -665,12 +665,10 @@ class WP_Terms_List_Table extends WP_List_Table {
-
-
-
-
-
-
+
+
+
+
diff --git a/wp-admin/includes/ms-admin-filters.php b/wp-admin/includes/ms-admin-filters.php
index 9e5fcaf2a9..b1d73825f1 100644
--- a/wp-admin/includes/ms-admin-filters.php
+++ b/wp-admin/includes/ms-admin-filters.php
@@ -22,9 +22,6 @@ add_action( 'wpmueditblogaction', 'upload_space_setting' );
// Network hooks.
add_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 );
-// Taxonomy hooks.
-add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
-
// Post hooks.
add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
diff --git a/wp-admin/includes/ms-deprecated.php b/wp-admin/includes/ms-deprecated.php
index fb45676a4e..519159b61b 100644
--- a/wp-admin/includes/ms-deprecated.php
+++ b/wp-admin/includes/ms-deprecated.php
@@ -108,3 +108,33 @@ function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
* @deprecated 3.5.0
*/
function ms_deprecated_blogs_file() {}
+
+if ( ! function_exists( 'install_global_terms' ) ) :
+ /**
+ * Install global terms.
+ *
+ * @since 3.0.0
+ * @since 6.1.0 This function no longer does anything.
+ * @deprecated 6.1.0
+ */
+ function install_global_terms() {
+ _deprecated_function( __FUNCTION__, '6.1.0' );
+ }
+endif;
+
+/**
+ * Synchronizes category and post tag slugs when global terms are enabled.
+ *
+ * @since 3.0.0
+ * @since 6.1.0 This function no longer does anything.
+ * @deprecated 6.1.0
+ *
+ * @param WP_Term|array $term The term.
+ * @param string $taxonomy The taxonomy for `$term`.
+ * @return WP_Term|array Always returns `$term`.
+ */
+function sync_category_tag_slugs( $term, $taxonomy ) {
+ _deprecated_function( __FUNCTION__, '6.1.0' );
+
+ return $term;
+}
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index af5bd1abd4..741d02e9c9 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -543,29 +543,6 @@ function format_code_lang( $code = '' ) {
return strtr( $code, $lang_codes );
}
-/**
- * Synchronizes category and post tag slugs when global terms are enabled.
- *
- * @since 3.0.0
- *
- * @param WP_Term|array $term The term.
- * @param string $taxonomy The taxonomy for `$term`. Should be 'category' or 'post_tag', as these are
- * the only taxonomies which are processed by this function; anything else
- * will be returned untouched.
- * @return WP_Term|array Returns `$term`, after filtering the 'slug' field with `sanitize_title()`
- * if `$taxonomy` is 'category' or 'post_tag'.
- */
-function sync_category_tag_slugs( $term, $taxonomy ) {
- if ( global_terms_enabled() && ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) ) {
- if ( is_object( $term ) ) {
- $term->slug = sanitize_title( $term->name );
- } else {
- $term['slug'] = sanitize_title( $term['name'] );
- }
- }
- return $term;
-}
-
/**
* Displays an access denied message when a user tries to view a site's dashboard they
* do not have access to.
diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php
index 504acbf949..c8bc92e44c 100644
--- a/wp-admin/includes/schema.php
+++ b/wp-admin/includes/schema.php
@@ -1270,7 +1270,6 @@ We hope you enjoy your new site. Thanks!
'add_new_users' => '0',
'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1',
'subdomain_install' => $subdomain_install,
- 'global_terms_enabled' => global_terms_enabled() ? '1' : '0',
'ms_files_rewriting' => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0',
'user_count' => get_site_option( 'user_count' ),
'initial_db_version' => get_option( 'initial_db_version' ),
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index 5030483769..802269e047 100644
--- a/wp-admin/includes/upgrade.php
+++ b/wp-admin/includes/upgrade.php
@@ -159,24 +159,7 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
/* translators: Default category slug. */
$cat_slug = sanitize_title( _x( 'Uncategorized', 'Default category slug' ) );
- if ( global_terms_enabled() ) {
- $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
- if ( null == $cat_id ) {
- $wpdb->insert(
- $wpdb->sitecategories,
- array(
- 'cat_ID' => 0,
- 'cat_name' => $cat_name,
- 'category_nicename' => $cat_slug,
- 'last_updated' => current_time( 'mysql', true ),
- )
- );
- $cat_id = $wpdb->insert_id;
- }
- update_option( 'default_category', $cat_id );
- } else {
- $cat_id = 1;
- }
+ $cat_id = 1;
$wpdb->insert(
$wpdb->terms,
@@ -3537,33 +3520,6 @@ function pre_schema_upgrade() {
}
}
-if ( ! function_exists( 'install_global_terms' ) ) :
- /**
- * Install global terms.
- *
- * @since 3.0.0
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- * @global string $charset_collate
- */
- function install_global_terms() {
- global $wpdb, $charset_collate;
- $ms_queries = "
-CREATE TABLE $wpdb->sitecategories (
- cat_ID bigint(20) NOT NULL auto_increment,
- cat_name varchar(55) NOT NULL default '',
- category_nicename varchar(200) NOT NULL default '',
- last_updated timestamp NOT NULL,
- PRIMARY KEY (cat_ID),
- KEY category_nicename (category_nicename),
- KEY last_updated (last_updated)
-) $charset_collate;
-";
- // Now create tables.
- dbDelta( $ms_queries );
- }
-endif;
-
/**
* Determine if global tables should be upgraded.
*
diff --git a/wp-admin/network/settings.php b/wp-admin/network/settings.php
index 75c13ae863..d162be751b 100644
--- a/wp-admin/network/settings.php
+++ b/wp-admin/network/settings.php
@@ -100,7 +100,6 @@ if ( $_POST ) {
'welcome_email',
'welcome_user_email',
'fileupload_maxk',
- 'global_terms_enabled',
'illegal_names',
'limited_email_domains',
'banned_email_domains',
diff --git a/wp-includes/class-wpdb.php b/wp-includes/class-wpdb.php
index e81b9caf79..043bca0a07 100644
--- a/wp-includes/class-wpdb.php
+++ b/wp-includes/class-wpdb.php
@@ -340,10 +340,19 @@ class wpdb {
'signups',
'site',
'sitemeta',
- 'sitecategories',
'registration_log',
);
+ /**
+ * List of deprecated WordPress Multisite global tables.
+ *
+ * @since 6.1.0
+ *
+ * @see wpdb::tables()
+ * @var string[]
+ */
+ public $old_ms_global_tables = array( 'sitecategories' );
+
/**
* WordPress Comments table.
*
@@ -1123,11 +1132,13 @@ class wpdb {
* - 'old' - returns tables which are deprecated.
*
* @since 3.0.0
+ * @since 6.1.0 `old` now includes deprecated multisite global tables only on multisite.
*
* @uses wpdb::$tables
* @uses wpdb::$old_tables
* @uses wpdb::$global_tables
* @uses wpdb::$ms_global_tables
+ * @uses wpdb::$old_ms_global_tables
*
* @param string $scope Optional. Possible values include 'all', 'global', 'ms_global', 'blog',
* or 'old' tables. Default 'all'.
@@ -1159,6 +1170,9 @@ class wpdb {
break;
case 'old':
$tables = $this->old_tables;
+ if ( is_multisite() ) {
+ $tables = array_merge( $tables, $this->old_ms_global_tables );
+ }
break;
default:
return array();
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 5d32afa578..f78b0cc6ff 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -6219,41 +6219,6 @@ function get_main_network_id() {
return (int) apply_filters( 'get_main_network_id', $main_network_id );
}
-/**
- * Determines whether global terms are enabled.
- *
- * @since 3.0.0
- *
- * @return bool True if multisite and global terms enabled.
- */
-function global_terms_enabled() {
- if ( ! is_multisite() ) {
- return false;
- }
-
- static $global_terms = null;
- if ( is_null( $global_terms ) ) {
-
- /**
- * Filters whether global terms are enabled.
- *
- * Returning a non-null value from the filter will effectively short-circuit the function
- * and return the value of the 'global_terms_enabled' site option instead.
- *
- * @since 3.0.0
- *
- * @param null $enabled Whether global terms are enabled.
- */
- $filter = apply_filters( 'global_terms_enabled', null );
- if ( ! is_null( $filter ) ) {
- $global_terms = (bool) $filter;
- } else {
- $global_terms = (bool) get_site_option( 'global_terms_enabled', false );
- }
- }
- return $global_terms;
-}
-
/**
* Determines whether site meta is enabled.
*
diff --git a/wp-includes/ms-default-filters.php b/wp-includes/ms-default-filters.php
index 3411e7dba0..c0af7215ff 100644
--- a/wp-includes/ms-default-filters.php
+++ b/wp-includes/ms-default-filters.php
@@ -75,7 +75,6 @@ add_action( 'template_redirect', 'maybe_redirect_404' );
add_filter( 'allowed_redirect_hosts', 'redirect_this_site' );
// Administration.
-add_filter( 'term_id_filter', 'global_terms', 10, 2 );
add_action( 'after_delete_post', '_update_posts_count_on_delete' );
add_action( 'delete_post', '_update_blog_date_on_post_delete' );
add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 );
diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php
index 6ce7af2be8..224dc1586d 100644
--- a/wp-includes/ms-deprecated.php
+++ b/wp-includes/ms-deprecated.php
@@ -730,3 +730,34 @@ function update_user_status( $id, $pref, $value, $deprecated = null ) {
return $value;
}
+/**
+ * Determines whether global terms are enabled.
+ *
+ * @since 3.0.0
+ * @since 6.1.0 This function now always returns false.
+ * @deprecated 6.1.0
+ *
+ * @return bool Always returns false.
+ */
+function global_terms_enabled() {
+ _deprecated_function( __FUNCTION__, '6.1.0' );
+
+ return false;
+}
+
+/**
+ * Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.
+ *
+ * @since 3.0.0
+ * @since 6.1.0 This function no longer does anything.
+ * @deprecated 6.1.0
+ *
+ * @param int $term_id An ID for a term on the current blog.
+ * @param string $deprecated Not used.
+ * @return int An ID from the global terms table mapped from $term_id.
+ */
+function global_terms( $term_id, $deprecated = '' ) {
+ _deprecated_function( __FUNCTION__, '6.1.0' );
+
+ return $term_id;
+}
diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php
index 2bb9c276dd..b48848b45e 100644
--- a/wp-includes/ms-functions.php
+++ b/wp-includes/ms-functions.php
@@ -2049,97 +2049,6 @@ function wpmu_log_new_registrations( $blog_id, $user_id ) {
}
}
-/**
- * Maintains a canonical list of terms by syncing terms created for each blog with the global terms table.
- *
- * @since 3.0.0
- *
- * @see term_id_filter
- *
- * @global wpdb $wpdb WordPress database abstraction object.
- *
- * @param int $term_id An ID for a term on the current blog.
- * @param string $deprecated Not used.
- * @return int An ID from the global terms table mapped from $term_id.
- */
-function global_terms( $term_id, $deprecated = '' ) {
- global $wpdb;
- static $global_terms_recurse = null;
-
- if ( ! global_terms_enabled() ) {
- return $term_id;
- }
-
- // Prevent a race condition.
- $recurse_start = false;
- if ( null === $global_terms_recurse ) {
- $recurse_start = true;
- $global_terms_recurse = 1;
- } elseif ( 10 < $global_terms_recurse++ ) {
- return $term_id;
- }
-
- $term_id = (int) $term_id;
- $c = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %d", $term_id ) );
-
- $global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s", $c->slug ) );
- if ( null == $global_id ) {
- $used_global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d", $c->term_id ) );
- if ( null == $used_global_id ) {
- $wpdb->insert(
- $wpdb->sitecategories,
- array(
- 'cat_ID' => $term_id,
- 'cat_name' => $c->name,
- 'category_nicename' => $c->slug,
- )
- );
- $global_id = $wpdb->insert_id;
- if ( empty( $global_id ) ) {
- return $term_id;
- }
- } else {
- $max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
- $max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" );
- $new_global_id = max( $max_global_id, $max_local_id ) + mt_rand( 100, 400 );
- $wpdb->insert(
- $wpdb->sitecategories,
- array(
- 'cat_ID' => $new_global_id,
- 'cat_name' => $c->name,
- 'category_nicename' => $c->slug,
- )
- );
- $global_id = $wpdb->insert_id;
- }
- } elseif ( $global_id != $term_id ) {
- $local_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) );
- if ( null != $local_id ) {
- global_terms( $local_id );
- if ( 10 < $global_terms_recurse ) {
- $global_id = $term_id;
- }
- }
- }
-
- if ( $global_id != $term_id ) {
- if ( get_option( 'default_category' ) == $term_id ) {
- update_option( 'default_category', $global_id );
- }
-
- $wpdb->update( $wpdb->terms, array( 'term_id' => $global_id ), array( 'term_id' => $term_id ) );
- $wpdb->update( $wpdb->term_taxonomy, array( 'term_id' => $global_id ), array( 'term_id' => $term_id ) );
- $wpdb->update( $wpdb->term_taxonomy, array( 'parent' => $global_id ), array( 'parent' => $term_id ) );
-
- clean_term_cache( $term_id );
- }
- if ( $recurse_start ) {
- $global_terms_recurse = null;
- }
-
- return $global_id;
-}
-
/**
* Ensures that the current site's domain is listed in the allowed redirect host list.
*
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 83ba3f1159..ddfac1876b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '6.1-alpha-54239';
+$wp_version = '6.1-alpha-54240';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.