WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/21/2010 02:29:11 AM (11 years ago)
Author:
dd32
Message:

Use correct cap checks and nonces for custom post_type's

File:
1 edited

Legend:

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

    r13784 r13786  
    811811        $post_type = get_post_type_object( $post->post_type );
    812812        if ( $post_type && 'post' != $post_type->capability_type ) {
    813             $args = array_merge( array( 'delete_' . $post_type->capability_type, $user_id ), $args );
     813            $args = array_merge( array( $post_type->delete_cap, $user_id ), $args );
    814814            return call_user_func_array( 'map_meta_cap', $args );
    815815        }
     
    888888        $post_type = get_post_type_object( $post->post_type );
    889889        if ( $post_type && 'post' != $post_type->capability_type ) {
    890             $args = array_merge( array( 'edit_' . $post_type->capability_type, $user_id ), $args );
     890            $args = array_merge( array( $post_type->edit_cap, $user_id ), $args );
    891891            return call_user_func_array( 'map_meta_cap', $args );
    892892        }
     
    947947        $post_type = get_post_type_object( $post->post_type );
    948948        if ( $post_type && 'post' != $post_type->capability_type ) {
    949             $args = array_merge( array( 'read_' . $post_type->capability_type, $user_id ), $args );
     949            $args = array_merge( array( $post_type->read_cap, $user_id ), $args );
    950950            return call_user_func_array( 'map_meta_cap', $args );
    951951        }
Note: See TracChangeset for help on using the changeset viewer.