Don't check post_type_supports in map_meta_cap. see #14122.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -831,11 +831,10 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
|
||||
if ( '' != $post->post_author ) {
|
||||
$post_author_data = get_userdata( $post->post_author );
|
||||
} else {
|
||||
// No author set yet or post type doesn't support authors,
|
||||
// so default to current user for cap checks.
|
||||
// No author set yet, so default to current user for cap checks.
|
||||
$post_author_data = $author_data;
|
||||
}
|
||||
|
||||
@@ -874,11 +873,10 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
|
||||
if ( '' != $post->post_author ) {
|
||||
$post_author_data = get_userdata( $post->post_author );
|
||||
} else {
|
||||
// No author set yet or post type doesn't support authors,
|
||||
// so default to current user for cap checks.
|
||||
// No author set yet, so default to current user for cap checks.
|
||||
$post_author_data = $author_data;
|
||||
}
|
||||
|
||||
@@ -921,11 +919,10 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
|
||||
if ( '' != $post->post_author ) {
|
||||
$post_author_data = get_userdata( $post->post_author );
|
||||
} else {
|
||||
// No author set yet or post type doesn't support authors,
|
||||
// so default to current user for cap checks.
|
||||
// No author set yet, so default to current user for cap checks.
|
||||
$post_author_data = $author_data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user