mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user