Description
Synchronize category and post tag slugs when global terms are enabled.
Usage
<?php sync_category_tag_slugs( $term, $taxonomy ); ?>
Parameters
- $term
- (object|array) (required) The term.
- Default: None
- $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.
- Default: None
Returns Values
- (object|array)
- Returns $term, after filtering the 'slug' field with sanitize_title() if $taxonomy is 'category' or 'post_tag'.
Examples
This function is not intended to be called directly, but is hooked to the 'get_term' filter by default.
Notes
- Uses: global_terms_enabled() - To check if global terms are enabled. If not the $term is not filtered.
- Uses: sanitize_title() - To filter $term slug if $taxonomy is 'category' or 'post_tag'.
Change Log
Source File
sync_category_tag_slugs() is located in wp-admin/includes/ms.php
.
Related