Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: auth_{$object_type}_meta_{$meta_key}

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