diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 70d651ff5..0c95173e4 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -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; } diff --git a/wp-includes/post.php b/wp-includes/post.php index 1098ede9d..8785b69b3 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1086,7 +1086,8 @@ function get_post_type_capabilities( $args ) { } if ( ! post_type_supports( $args->name, 'author' ) ) { - // While these may be checked in core, users/roles shouldn't need to be granted these. + // While these may be checked in core, users/roles shouldn't need to be + // granted these by default if the post type doesn't support authors. $default_capabilities['edit_others_posts'] = $default_capabilities['edit_posts']; if ( $args->map_meta_cap ) $default_capabilities['delete_others_posts'] = $default_capabilities['delete_posts'];