Use correct cap checks and nonces for custom post_type's

git-svn-id: https://develop.svn.wordpress.org/trunk@13786 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-03-21 02:29:11 +00:00
parent ef46c26f1b
commit 6f62362b96
3 changed files with 11 additions and 12 deletions

View File

@@ -810,7 +810,7 @@ function map_meta_cap( $cap, $user_id ) {
$post = get_post( $args[0] );
$post_type = get_post_type_object( $post->post_type );
if ( $post_type && 'post' != $post_type->capability_type ) {
$args = array_merge( array( 'delete_' . $post_type->capability_type, $user_id ), $args );
$args = array_merge( array( $post_type->delete_cap, $user_id ), $args );
return call_user_func_array( 'map_meta_cap', $args );
}
@@ -887,7 +887,7 @@ function map_meta_cap( $cap, $user_id ) {
$post = get_post( $args[0] );
$post_type = get_post_type_object( $post->post_type );
if ( $post_type && 'post' != $post_type->capability_type ) {
$args = array_merge( array( 'edit_' . $post_type->capability_type, $user_id ), $args );
$args = array_merge( array( $post_type->edit_cap, $user_id ), $args );
return call_user_func_array( 'map_meta_cap', $args );
}
$post_author_data = get_userdata( $post->post_author );
@@ -946,7 +946,7 @@ function map_meta_cap( $cap, $user_id ) {
$post = get_post( $args[0] );
$post_type = get_post_type_object( $post->post_type );
if ( $post_type && 'post' != $post_type->capability_type ) {
$args = array_merge( array( 'read_' . $post_type->capability_type, $user_id ), $args );
$args = array_merge( array( $post_type->read_cap, $user_id ), $args );
return call_user_func_array( 'map_meta_cap', $args );
}