Ensure the map_meta_cap filter receives the right cap when the map_meta_cap flag is false. fixes #15779.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0f6329b74f
commit
cd51624aba
|
@ -828,6 +828,9 @@ function map_meta_cap( $cap, $user_id ) {
|
||||||
|
|
||||||
if ( ! $post_type->map_meta_cap ) {
|
if ( ! $post_type->map_meta_cap ) {
|
||||||
$caps[] = $post_type->cap->$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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,6 +873,9 @@ function map_meta_cap( $cap, $user_id ) {
|
||||||
|
|
||||||
if ( ! $post_type->map_meta_cap ) {
|
if ( ! $post_type->map_meta_cap ) {
|
||||||
$caps[] = $post_type->cap->$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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -911,6 +917,9 @@ function map_meta_cap( $cap, $user_id ) {
|
||||||
|
|
||||||
if ( ! $post_type->map_meta_cap ) {
|
if ( ! $post_type->map_meta_cap ) {
|
||||||
$caps[] = $post_type->cap->$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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue