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 |
|---|---|
| 298 | } |
| 299 | |
| 300 | $caps = map_meta_cap( "edit_{$object_type}", $user_id, $object_id ); |
| 301 | |
| 302 | $meta_key = isset( $args[1] ) ? $args[1] : false; |
| 303 | |
| 304 | $has_filter = has_filter( "auth_{$object_type}_meta_{$meta_key}" ) || has_filter( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}" ); |
| 305 | if ( $meta_key && $has_filter ) { |
| 306 | /** This filter is documented in wp-includes/meta.php */ |
| 307 | $allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", false, $meta_key, $object_id, $user_id, $cap, $caps ); |
| 308 | |
| 309 | /** This filter is documented in wp-includes/meta.php */ |
| 310 | $allowed = apply_filters( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps ); |
| 311 | |
| 312 | if ( ! $allowed ) { |
| 313 | $caps[] = $cap; |
| 314 | } |
| 315 | } elseif ( $meta_key && is_protected_meta( $meta_key, $object_type ) ) { |
| 316 | $caps[] = $cap; |