WordPress.org

Make WordPress Core

Changeset 16909


Ignore:
Timestamp:
12/14/2010 11:22:32 AM (11 years ago)
Author:
nacin
Message:

Ensure the map_meta_cap filter receives the right cap when the map_meta_cap flag is false. fixes #15779.

File:
1 edited

Legend:

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

    r16551 r16909  
    829829        if ( ! $post_type->map_meta_cap ) {
    830830            $caps[] = $post_type->cap->$cap;
     831            // Prior to 3.1 we would re-call map_meta_cap here.
     832            if ( $cap == 'delete_post' )
     833                $cap = $post_type->cap->$cap;
    831834            break;
    832835        }
     
    871874        if ( ! $post_type->map_meta_cap ) {
    872875            $caps[] = $post_type->cap->$cap;
     876            // Prior to 3.1 we would re-call map_meta_cap here.
     877            if ( $cap == 'edit_post' )
     878                $cap = $post_type->cap->$cap;
    873879            break;
    874880        }
     
    912918        if ( ! $post_type->map_meta_cap ) {
    913919            $caps[] = $post_type->cap->$cap;
     920            // Prior to 3.1 we would re-call map_meta_cap here.
     921            if ( $cap == 'read_post' )
     922                $cap = $post_type->cap->$cap;
    914923            break;
    915924        }
Note: See TracChangeset for help on using the changeset viewer.