<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[54240] trunk: Networks and Sites: Officially remove global terms.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/54240">54240</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/54240","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>desrosj</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-09-20 02:49:25 +0000 (Tue, 20 Sep 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Networks and Sites: Officially remove global terms.
Global terms was a feature from the WordPress MU days where multisite and single site installs used different code bases.
In WordPress 3.0, WordPress MU was merged into one location and the UI <a href="https://core.trac.wordpress.org/changeset/14854">[14854]</a> and {U+201C}on{U+201D} switch <a href="https://core.trac.wordpress.org/changeset/14880">[14880]</a> for global terms were completely removed.
Even before this merge, global terms was bug infested and unreliable. After <a href="https://core.trac.wordpress.org/changeset/14854">[14854]</a>/<a href="https://core.trac.wordpress.org/changeset/14880">[14880]</a>, the feature was no longer maintained and became increasingly broken as taxonomies progressed without it (term splitting and term meta do not work at all). At this point, the feature has not worked in 12+ years and there's no hope for saving it.
This deprecates the remaining global terms related code and no-ops the functions.
Global terms, you don't have to go home, but you can't stay here.
Props scribu, wonderboymusic, SergeyBiryukov, nacin, pento, desrosj, johnjamesjacoby, johnbillion, dd32.
Fixes <a href="https://core.trac.wordpress.org/ticket/21734">#21734</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminedittagformphp">trunk/src/wp-admin/edit-tag-form.php</a></li>
<li><a href="#trunksrcwpadminedittagsphp">trunk/src/wp-admin/edit-tags.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswptermslisttablephp">trunk/src/wp-admin/includes/class-wp-terms-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesmsadminfiltersphp">trunk/src/wp-admin/includes/ms-admin-filters.php</a></li>
<li><a href="#trunksrcwpadminincludesmsdeprecatedphp">trunk/src/wp-admin/includes/ms-deprecated.php</a></li>
<li><a href="#trunksrcwpadminincludesmsphp">trunk/src/wp-admin/includes/ms.php</a></li>
<li><a href="#trunksrcwpadminincludesschemaphp">trunk/src/wp-admin/includes/schema.php</a></li>
<li><a href="#trunksrcwpadminincludesupgradephp">trunk/src/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunksrcwpadminnetworksettingsphp">trunk/src/wp-admin/network/settings.php</a></li>
<li><a href="#trunksrcwpincludesclasswpdbphp">trunk/src/wp-includes/class-wpdb.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludesmsdefaultfiltersphp">trunk/src/wp-includes/ms-default-filters.php</a></li>
<li><a href="#trunksrcwpincludesmsdeprecatedphp">trunk/src/wp-includes/ms-deprecated.php</a></li>
<li><a href="#trunksrcwpincludesmsfunctionsphp">trunk/src/wp-includes/ms-functions.php</a></li>
<li><a href="#trunktestsphpunittestspluggablephp">trunk/tests/phpunit/tests/pluggable.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminedittagformphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/edit-tag-form.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-tag-form.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/edit-tag-form.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" aria-describedby="name-description" />
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="description" id="name-description"><?php echo $tax->labels->name_field_description; ?></p></td>
</span><span class="cx" style="display: block; padding: 0 10px"> </tr>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php if ( ! global_terms_enabled() ) { ?>
</del><span class="cx" style="display: block; padding: 0 10px"> <tr class="form-field term-slug-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <th scope="row"><label for="slug"><?php _e( 'Slug' ); ?></label></th>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +169,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" aria-describedby="slug-description" />
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="description" id="slug-description"><?php echo $tax->labels->slug_field_description; ?></p></td>
</span><span class="cx" style="display: block; padding: 0 10px"> </tr>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php } ?>
</del><span class="cx" style="display: block; padding: 0 10px"> <?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <tr class="form-field term-parent-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <th scope="row"><label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label></th>
</span></span></pre></div>
<a id="trunksrcwpadminedittagsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/edit-tags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-tags.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/edit-tags.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -280,9 +280,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $help .= '<ul>' .
</span><span class="cx" style="display: block; padding: 0 10px"> '<li>' . __( '<strong>Name</strong> — The name is how it appears on your site.' ) . '</li>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! global_terms_enabled() ) {
- $help .= '<li>' . __( '<strong>Slug</strong> — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $help .= '<li>' . __( '<strong>Slug</strong> — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'category' === $taxonomy ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $help .= '<li>' . __( '<strong>Parent</strong> — 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.' ) . '</li>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -456,13 +454,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" aria-describedby="name-description" />
</span><span class="cx" style="display: block; padding: 0 10px"> <p id="name-description"><?php echo $tax->labels->name_field_description; ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( ! global_terms_enabled() ) : ?>
</del><span class="cx" style="display: block; padding: 0 10px"> <div class="form-field term-slug-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <label for="tag-slug"><?php _e( 'Slug' ); ?></label>
</span><span class="cx" style="display: block; padding: 0 10px"> <input name="slug" id="tag-slug" type="text" value="" size="40" aria-describedby="slug-description" />
</span><span class="cx" style="display: block; padding: 0 10px"> <p id="slug-description"><?php echo $tax->labels->slug_field_description; ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php endif; // global_terms_enabled() ?>
</del><span class="cx" style="display: block; padding: 0 10px"> <?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="form-field term-parent-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label>
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswptermslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-terms-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-terms-list-table.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/includes/class-wp-terms-list-table.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,12 +665,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
</span><span class="cx" style="display: block; padding: 0 10px"> </label>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( ! global_terms_enabled() ) : ?>
- <label>
- <span class="title"><?php _e( 'Slug' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
- </label>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label>
+ <span class="title"><?php _e( 'Slug' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
+ </label>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </fieldset>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesmsadminfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ms-admin-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms-admin-filters.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/includes/ms-admin-filters.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,9 +22,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Network hooks.
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// Taxonomy hooks.
-add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Post hooks.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesmsdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ms-deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms-deprecated.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/includes/ms-deprecated.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,3 +108,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @deprecated 3.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function ms_deprecated_blogs_file() {}
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+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;
+}
</ins></span></pre></div>
<a id="trunksrcwpadminincludesmsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/includes/ms.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -544,29 +544,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 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;
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Displays an access denied message when a user tries to view a site's dashboard they
</span><span class="cx" style="display: block; padding: 0 10px"> * do not have access to.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunksrcwpadminincludesschemaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/schema.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/schema.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/includes/schema.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1270,7 +1270,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'add_new_users' => '0',
</span><span class="cx" style="display: block; padding: 0 10px"> 'upload_space_check_disabled' => is_multisite() ? get_site_option( 'upload_space_check_disabled' ) : '1',
</span><span class="cx" style="display: block; padding: 0 10px"> 'subdomain_install' => $subdomain_install,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'global_terms_enabled' => global_terms_enabled() ? '1' : '0',
</del><span class="cx" style="display: block; padding: 0 10px"> 'ms_files_rewriting' => is_multisite() ? get_site_option( 'ms_files_rewriting' ) : '0',
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_count' => get_site_option( 'user_count' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'initial_db_version' => get_option( 'initial_db_version' ),
</span></span></pre></div>
<a id="trunksrcwpadminincludesupgradephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/upgrade.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/upgrade.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/includes/upgrade.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,24 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: Default category slug. */
</span><span class="cx" style="display: block; padding: 0 10px"> $cat_slug = sanitize_title( _x( 'Uncategorized', 'Default category slug' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cat_id = 1;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->insert(
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->terms,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3537,33 +3520,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-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;
-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Determine if global tables should be upgraded.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunksrcwpadminnetworksettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/settings.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-admin/network/settings.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,7 +100,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'welcome_email',
</span><span class="cx" style="display: block; padding: 0 10px"> 'welcome_user_email',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fileupload_maxk',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'global_terms_enabled',
</del><span class="cx" style="display: block; padding: 0 10px"> 'illegal_names',
</span><span class="cx" style="display: block; padding: 0 10px"> 'limited_email_domains',
</span><span class="cx" style="display: block; padding: 0 10px"> 'banned_email_domains',
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wpdb.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wpdb.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-includes/class-wpdb.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,11 +340,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'signups',
</span><span class="cx" style="display: block; padding: 0 10px"> 'site',
</span><span class="cx" style="display: block; padding: 0 10px"> 'sitemeta',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'sitecategories',
</del><span class="cx" style="display: block; padding: 0 10px"> 'registration_log',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * List of deprecated WordPress Multisite global tables.
+ *
+ * @since 6.1.0
+ *
+ * @see wpdb::tables()
+ * @var string[]
+ */
+ public $old_ms_global_tables = array( 'sitecategories' );
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * WordPress Comments table.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1123,11 +1132,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'old' - returns tables which are deprecated.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.1.0 `old` now includes deprecated multisite global tables only on multisite.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wpdb::$tables
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wpdb::$old_tables
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wpdb::$global_tables
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wpdb::$ms_global_tables
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @uses wpdb::$old_ms_global_tables
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $scope Optional. Possible values include 'all', 'global', 'ms_global', 'blog',
</span><span class="cx" style="display: block; padding: 0 10px"> * or 'old' tables. Default 'all'.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1159,6 +1170,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'old':
</span><span class="cx" style="display: block; padding: 0 10px"> $tables = $this->old_tables;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_multisite() ) {
+ $tables = array_merge( $tables, $this->old_ms_global_tables );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-includes/functions.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6220,41 +6220,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 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;
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Determines whether site meta is enabled.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This function checks whether the 'blogmeta' database table exists. The result is saved as
</span></span></pre></div>
<a id="trunksrcwpincludesmsdefaultfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ms-default-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-default-filters.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-includes/ms-default-filters.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,7 +75,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'allowed_redirect_hosts', 'redirect_this_site' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Administration.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_filter( 'term_id_filter', 'global_terms', 10, 2 );
</del><span class="cx" style="display: block; padding: 0 10px"> add_action( 'after_delete_post', '_update_posts_count_on_delete' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'delete_post', '_update_blog_date_on_post_delete' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 );
</span></span></pre></div>
<a id="trunksrcwpincludesmsdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ms-deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-deprecated.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-includes/ms-deprecated.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -730,3 +730,34 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * 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;
+}
</ins></span></pre></div>
<a id="trunksrcwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ms-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-functions.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/src/wp-includes/ms-functions.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2050,97 +2050,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 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;
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Ensures that the current site's domain is listed in the allowed redirect host list.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_validate_redirect()
</span></span></pre></div>
<a id="trunktestsphpunittestspluggablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pluggable.php 2022-09-20 02:22:49 UTC (rev 54239)
+++ trunk/tests/phpunit/tests/pluggable.php 2022-09-20 02:49:25 UTC (rev 54240)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_install_defaults',
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_new_blog_notification',
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_upgrade',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'install_global_terms',
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $test_files = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-includes/pluggable.php',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,7 +256,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_install_defaults' => array( 'user_id' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_new_blog_notification' => array( 'blog_title', 'blog_url', 'user_id', 'password' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_upgrade' => array(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'install_global_terms' => array(),
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Pluggable function signatures are not tested when an external object cache is in use. See #31491.
</span></span></pre>
</div>
</div>
</body>
</html>