clean_object_term_cache( int|array $object_ids, array|string $object_type )
Removes the taxonomy relationship to terms from the cache.
描述
Will remove the entire taxonomy relationship containing term $object_id
. The term IDs have to exist within the taxonomy $object_type
for the deletion to take place.
参数
- $object_ids
-
(int|array)
(Required)
Single or list of term object ID(s). - $object_type
-
(array|string)
(Required)
The taxonomy object type.
源代码
File: wp-includes/taxonomy.php
function clean_object_term_cache($object_ids, $object_type) {
global $_wp_suspend_cache_invalidation;
if ( ! empty( $_wp_suspend_cache_invalidation ) ) {
return;
}
if ( !is_array($object_ids) )
$object_ids = array($object_ids);
$taxonomies = get_object_taxonomies( $object_type );
foreach ( $object_ids as $id ) {
foreach ( $taxonomies as $taxonomy ) {
wp_cache_delete($id, "{$taxonomy}_relationships");
}
}
/**
* Fires after the object term cache has been cleaned.
*
* @since 2.5.0
*
* @param array $object_ids An array of object IDs.
* @param string $object_type Object type.
*/
do_action( 'clean_object_term_cache', $object_ids, $object_type );
}
更新日志
Version | 描述 |
---|---|
2.3.0 | Introduced. |
相关函数
Uses
-
wp-includes/cache.php:
wp_cache_delete() -
wp-includes/taxonomy.php:
clean_object_term_cache -
wp-includes/taxonomy.php:
get_object_taxonomies() -
wp-includes/plugin.php:
do_action()
Used By
-
wp-includes/taxonomy.php:
wp_delete_term() -
wp-includes/post.php:
clean_post_cache() -
wp-includes/post.php:
clean_attachment_cache() -
wp-includes/bookmark.php:
clean_bookmark_cache()
User Contributed Notes
你可能对这些文章感兴趣:
- wordpress函数gd_edit_image_support()用法示例
- wordpress函数funky_javascript_callback()用法示例
- wordpress函数funky_javascript_fix()用法示例
- wordpress函数gallery_shortcode()用法示例
- wordpress函数format_to_edit()用法示例
- wordpress函数format_to_post()用法示例
- wordpress函数form_option()用法示例
- wordpress函数format_code_lang()用法示例
- wordpress函数format_for_editor()用法示例
- wordpress函数force_ssl_login()用法示例
- wordpress函数force_ssl_content()用法示例
- wordpress函数flush_rewrite_rules()用法示例
- wordpress函数force_balance_tags()用法示例
- wordpress函数force_ssl_admin()用法示例
如有疑问,请前往问答中心反馈!
反馈