WordPress at Your Fingertips
function is not described

sync_category_tag_slugs() WP 3.0.0

Synchronizes category and post tag slugs when global terms are enabled.

No Hooks.

Return

WP_Term|Array. Returns $term, after filtering the 'slug' field with sanitize_title() $taxonomy is 'category' or 'post_tag'.

Usage

sync_category_tag_slugs( $term, $taxonomy );
$term(WP_Term|array) (required)
The term.
$taxonomy(string) (required)
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.

Changelog

Since 3.0.0 Introduced.

Code of sync_category_tag_slugs() WP 5.8.2

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;
}