From 12da6006e0ca71339bd7ff9929c8c05de0f65822 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 14 Dec 2010 11:22:32 +0000 Subject: [PATCH] Ensure the map_meta_cap filter receives the right cap when the map_meta_cap flag is false. fixes #15779. git-svn-id: https://develop.svn.wordpress.org/trunk@16909 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/capabilities.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 660ee50566..2ea5aeb488 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -828,6 +828,9 @@ function map_meta_cap( $cap, $user_id ) { if ( ! $post_type->map_meta_cap ) { $caps[] = $post_type->cap->$cap; + // Prior to 3.1 we would re-call map_meta_cap here. + if ( $cap == 'delete_post' ) + $cap = $post_type->cap->$cap; break; } @@ -870,6 +873,9 @@ function map_meta_cap( $cap, $user_id ) { if ( ! $post_type->map_meta_cap ) { $caps[] = $post_type->cap->$cap; + // Prior to 3.1 we would re-call map_meta_cap here. + if ( $cap == 'edit_post' ) + $cap = $post_type->cap->$cap; break; } @@ -911,6 +917,9 @@ function map_meta_cap( $cap, $user_id ) { if ( ! $post_type->map_meta_cap ) { $caps[] = $post_type->cap->$cap; + // Prior to 3.1 we would re-call map_meta_cap here. + if ( $cap == 'read_post' ) + $cap = $post_type->cap->$cap; break; }