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 |
---|---|
1164 | case 'edit_post_meta': |
1165 | case 'delete_post_meta': |
1166 | case 'add_post_meta': |
1167 | $post = get_post( $args[0] ); |
1168 | $caps = map_meta_cap( 'edit_post', $user_id, $post->ID ); |
1169 |
|
1170 | $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false; |
1171 |
|
1172 | if ( $meta_key && has_filter( "auth_post_meta_{$meta_key}" ) ) { |
1173 | $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps ); |
1174 | if ( ! $allowed ) |
1175 | $caps[] = $cap; |
1176 | } elseif ( $meta_key && is_protected_meta( $meta_key, 'post' ) ) { |
1177 | $caps[] = $cap; |
1178 | } |
1179 | break; |
1180 | case 'edit_comment': |
1181 | $comment = get_comment( $args[0] ); |
1182 | if ( empty( $comment ) ) |