函数
wp_term_is_shared ( $term_id )
- 参数
-
-
(int)
$term_id
Term ID.- Required: 是
-
(int)
- 返回值
-
- (bool) Returns false if a term is not shared between multiple taxonomies or if splitting shared taxonomy terms is finished.
- 定义位置
-
-
wp-includes/taxonomy.php
, line 4529
-
wp-includes/taxonomy.php
- 引入
- 4.4.0
- 弃用
- –
确定一个术语是否在多个分类法之间共享。
共享的分类法术语在4.3版本中开始被拆分,但cron任务失败或升级程序的其他延迟可能导致共享的术语仍然存在。
function wp_term_is_shared( $term_id ) { global $wpdb; if ( get_option( 'finished_splitting_shared_terms' ) ) { return false; } $tt_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term_id ) ); return $tt_count > 1; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。