mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Cripple capability_type. Produced inconsistent, janky meta cap mapping; now only acts as a capability base. see #14122.
git-svn-id: https://develop.svn.wordpress.org/trunk@16273 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -826,9 +826,9 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
$post = get_post( $args[0] );
|
||||
$post_type = get_post_type_object( $post->post_type );
|
||||
|
||||
if ( 'delete_post' == $cap && $post_type && 'post' != $post_type->capability_type && ! $post_type->map_meta_cap ) {
|
||||
$args = array_merge( array( $post_type->cap->delete_post, $user_id ), $args );
|
||||
return call_user_func_array( 'map_meta_cap', $args );
|
||||
if ( ! $post_type->map_meta_cap ) {
|
||||
$caps[] = $post_type->cap->$cap;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
|
||||
@@ -869,9 +869,9 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
$post = get_post( $args[0] );
|
||||
$post_type = get_post_type_object( $post->post_type );
|
||||
|
||||
if ( 'edit_post' == $cap && $post_type && 'post' != $post_type->capability_type && ! $post_type->map_meta_cap ) {
|
||||
$args = array_merge( array( $post_type->cap->edit_post, $user_id ), $args );
|
||||
return call_user_func_array( 'map_meta_cap', $args );
|
||||
if ( ! $post_type->map_meta_cap ) {
|
||||
$caps[] = $post_type->cap->$cap;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
|
||||
@@ -911,9 +911,9 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
$post = get_post( $args[0] );
|
||||
$post_type = get_post_type_object( $post->post_type );
|
||||
|
||||
if ( 'read_post' == $cap && $post_type && 'post' != $post_type->capability_type && ! $post_type->map_meta_cap ) {
|
||||
$args = array_merge( array( $post_type->cap->read_post, $user_id ), $args );
|
||||
return call_user_func_array( 'map_meta_cap', $args );
|
||||
if ( ! $post_type->map_meta_cap ) {
|
||||
$caps[] = $post_type->cap->$cap;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( 'private' != $post->post_status ) {
|
||||
|
||||
Reference in New Issue
Block a user