WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/10/2010 02:50:14 PM (10 years ago)
Author:
nacin
Message:

Cripple capability_type. Produced inconsistent, janky meta cap mapping; now only acts as a capability base. see #14122.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r16264 r16273  
    827827        $post_type = get_post_type_object( $post->post_type );
    828828
    829         if ( 'delete_post' == $cap && $post_type && 'post' != $post_type->capability_type && ! $post_type->map_meta_cap ) {
    830             $args = array_merge( array( $post_type->cap->delete_post, $user_id ), $args );
    831             return call_user_func_array( 'map_meta_cap', $args );
     829        if ( ! $post_type->map_meta_cap ) {
     830            $caps[] = $post_type->cap->$cap;
     831            break;
    832832        }
    833833
     
    870870        $post_type = get_post_type_object( $post->post_type );
    871871
    872         if ( 'edit_post' == $cap && $post_type && 'post' != $post_type->capability_type && ! $post_type->map_meta_cap ) {
    873             $args = array_merge( array( $post_type->cap->edit_post, $user_id ), $args );
    874             return call_user_func_array( 'map_meta_cap', $args );
     872        if ( ! $post_type->map_meta_cap ) {
     873            $caps[] = $post_type->cap->$cap;
     874            break;
    875875        }
    876876
     
    912912        $post_type = get_post_type_object( $post->post_type );
    913913
    914         if ( 'read_post' == $cap && $post_type && 'post' != $post_type->capability_type && ! $post_type->map_meta_cap ) {
    915             $args = array_merge( array( $post_type->cap->read_post, $user_id ), $args );
    916             return call_user_func_array( 'map_meta_cap', $args );
     914        if ( ! $post_type->map_meta_cap ) {
     915            $caps[] = $post_type->cap->$cap;
     916            break;
    917917        }
    918918
Note: See TracChangeset for help on using the changeset viewer.