update_{$meta_type}_metadata_cache WordPress Filter Hook

The update_{$meta_type}_metadata_cache hook is called when the metadata cache for a given meta type is updated. This hook gives you the opportunity to update your own cached data in response to changes in the metadata cache. For example, you might use this hook to invalidate your cached data when the post_modified timestamp changes.

apply_filters( "update_{$meta_type}_metadata_cache", mixed $check, int[] $object_ids ) #

Short-circuits updating the metadata cache of a specific type.


Description

The dynamic portion of the hook name, $meta_type, refers to the meta object type (post, comment, term, user, or any other type with an associated meta table). Returning a non-null value will effectively short-circuit the function.

Possible hook names include:

  • update_post_metadata_cache
  • update_comment_metadata_cache
  • update_term_metadata_cache
  • update_user_metadata_cache

Top ↑

Parameters

$check

(mixed)Whether to allow updating the meta cache of the given type.

$object_ids

(int[])Array of object IDs to update the meta cache for.


Top ↑

Source

File: wp-includes/meta.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.