Ticket #36319: 36319.patch
File 36319.patch, 2.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/capabilities.php
251 251 252 252 if ( $meta_key && ( has_filter( "auth_post_meta_{$meta_key}" ) || has_filter( "auth_post_{$post_type}_meta_{$meta_key}" ) ) ) { 253 253 /** 254 * Filters whether the user is allowed to add post meta to a post.254 * auth_post_meta_{$meta_key} filters whether the user is allowed to edit post meta. 255 255 * 256 * If the filter is left at false, the capability to add, edit, or delete post meta will 257 * be added to the mapped edit_post capabilities. 258 * 259 * If the filter is set to true, only the mapped meta caps from edit_post will apply. 260 * 261 * Use the auth_post_{$post_type}_meta_{$meta_key} filter to modify capabilities for 262 * specific post types. 263 * 256 264 * The dynamic portion of the hook name, `$meta_key`, refers to the 257 265 * meta key passed to map_meta_cap(). 258 266 * … … 268 276 $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps ); 269 277 270 278 /** 271 * Filters whether the user is allowed to add post meta to a post of a given type. 279 * auth_post_meta_{$meta_key} filters whether the user is allowed to edit post meta for 280 * a post of a given type. 272 281 * 282 * If the filter is left at false, the capability to add, edit, or delete post meta will 283 * be added to the mapped edit_post capabilities. 284 * 285 * If the filter is set to true, only the mapped meta caps from edit_post will apply. 286 * 287 * Use the auth_post_meta_{$meta_key} filter to modify capabilities for all types. 288 * 273 289 * The dynamic portions of the hook name, `$meta_key` and `$post_type`, 274 290 * refer to the meta key passed to map_meta_cap() and the post type, respectively. 275 291 * … … 284 300 */ 285 301 $allowed = apply_filters( "auth_post_{$post_type}_meta_{$meta_key}", $allowed, $meta_key, $post->ID, $user_id, $cap, $caps ); 286 302 287 if ( ! $allowed ) 303 if ( ! $allowed ) { 288 304 $caps[] = $cap; 305 } 289 306 } elseif ( $meta_key && is_protected_meta( $meta_key, 'post' ) ) { 290 307 $caps[] = $cap; 291 308 }