升级2.2版中的旧slu。

原型

upgrade_old_slugs()

源文件

路径:wp-admin/includes/upgrade.php

<?php
...
			// Associate terms with the same slug in a term group and make slugs unique.
			if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
				$term_group = $exists[0]->term_group;
				$term_id = $exists[0]->term_id;
			}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/upgrade_old_slugs/