Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: update_{$meta_type}_metadata_cache

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
914       * The dynamic portion of the hook, `$meta_type`, refers to the meta
915       * object type (comment, post, term, or user). Returning a non-null value
916       * will effectively short-circuit the function.
917       *
918       * @since 5.0.0
919       *
920       * @param mixed $check      Whether to allow updating the meta cache of the given type.
921       * @param int[] $object_ids Array of object IDs to update the meta cache for.
922       */
923      $check = apply_filters( "update_{$meta_type}_metadata_cache", null, $object_ids );
924      if ( null !== $check ) {
925           return (bool) $check;
926      }
927
928      $cache_key = $meta_type . '_meta';
929      $ids       = array();
930      $cache     = array();
931      foreach ( $object_ids as $id ) {
932           $cached_object = wp_cache_get( $id, $cache_key );