Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_{$meta_type}_metadata

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
244  * @return string|array Single metadata value, or array of values
245  */
246 function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
247      if ( !$meta_type )
248           return false;
249
250      if ( !$object_id = absint($object_id) )
251           return false;
252
253      $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
254      if ( null !== $check ) {
255           if ( $single && is_array( $check ) )
256                return $check[0];
257           else
258                return $check;
259      }
260
261      $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
262