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