Make WordPress Core


Ignore:
Timestamp:
05/12/2010 08:45:18 PM (15 years ago)
Author:
nacin
Message:

Move post type object capabilities to a 'cap' object. Allow them to be initialized via the 'capabilities' key (an array) when registering support for the post type. Caps are now referred to by the name of the cap as if it was a post, i.e. ->cap->edit_post. see #13358.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r14490 r14585  
    794794        return;
    795795
    796     if ( !current_user_can( $post_type_object->edit_cap, $post->ID ) )
     796    if ( !current_user_can( $post_type_object->cap->edit_post, $post->ID ) )
    797797        return;
    798798
     
    847847        return;
    848848
    849     if ( !current_user_can( $post_type_object->delete_cap, $post->ID ) )
     849    if ( !current_user_can( $post_type_object->cap->delete_post, $post->ID ) )
    850850        return;
    851851
Note: See TracChangeset for help on using the changeset viewer.