sync_category_tag_slugs()同步分类与标签

目录

描述

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

sync_category_tag_slugs() 描述

用法

<?php sync_category_tag_slugs$term$taxonomy ); ?>

sync_category_tag_slugs() 用法

参数

$term

(object|array) (必填) The term.

默认值: None

$taxonomy

(string) (必填) 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.

默认值: None

sync_category_tag_slugs() 参数

示例

This function is not intended to be called directly, but is hooked to the 'get_term' filter by default.

sync_category_tag_slugs() 示例

注意

  • 使用到: global_terms_enabled() - To check if global terms are enabled. If not the $term is not 过滤器ed.
  • 使用到: sanitize_title() - To 过滤器 $term slug if $taxonomy is 'category' or 'post_tag'.

sync_category_tag_slugs() 注意

历史

sync_category_tag_slugs() 历史

源文件

sync_category_tag_slugs() 函数的代码位于 wp-admin/includes/ms.php.

sync_category_tag_slugs() 源文件