wphooks.info - update_{$meta_type}_metadata_cache

update_{$meta_type}_metadata_cache

(trunk - 5.1-alpha-44286)

*** New in trunk ***

The hook occurs in the following file:

wp-includes/meta.php:
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
	 *
	 * The dynamic portion of the hook, `$meta_type`, refers to the meta
	 * object type (comment, post, term, or user). Returning a non-null value
	 * will effectively short-circuit the function.
	 *
	 * @since 5.0.0
	 *
	 * @param mixed $check      Whether to allow updating the meta cache of the given type.
	 * @param array $object_ids Array of object IDs to update the meta cache for.
	 */
	$check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );
	if ( null !== $check ) {
		return (bool) $check;
	}

	$cache_key = $meta_type . '_meta';
	$ids       = array();
	$cache     = array();
	foreach ( $object_ids as $id ) {
		$cached_object = wp_cache_get( $id, $cache_key );