Changeset 54240 for trunk/src/wp-admin/includes/ms.php
- Timestamp:
- 09/20/2022 02:49:25 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ms.php
r53203 r54240 545 545 546 546 /** 547 * Synchronizes category and post tag slugs when global terms are enabled.548 *549 * @since 3.0.0550 *551 * @param WP_Term|array $term The term.552 * @param string $taxonomy The taxonomy for `$term`. Should be 'category' or 'post_tag', as these are553 * the only taxonomies which are processed by this function; anything else554 * will be returned untouched.555 * @return WP_Term|array Returns `$term`, after filtering the 'slug' field with `sanitize_title()`556 * if `$taxonomy` is 'category' or 'post_tag'.557 */558 function sync_category_tag_slugs( $term, $taxonomy ) {559 if ( global_terms_enabled() && ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) ) {560 if ( is_object( $term ) ) {561 $term->slug = sanitize_title( $term->name );562 } else {563 $term['slug'] = sanitize_title( $term['name'] );564 }565 }566 return $term;567 }568 569 /**570 547 * Displays an access denied message when a user tries to view a site's dashboard they 571 548 * do not have access to.
Note: See TracChangeset
for help on using the changeset viewer.