WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| 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 | |