﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
17005,Replace cryptic bitwise check with proper post type checks,nacin,,"wp-admin/user-edit.php:54:

{{{
$all_post_caps = array('posts', 'pages');
$user_can_edit = false;
foreach ( $all_post_caps as $post_cap )
	$user_can_edit |= current_user_can(""edit_$post_cap"");
}}}

Could become:

{{{
$user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
}}}

It could also become:

{{{
$show_ui_post_types = get_post_types( ( 'show_ui' => true ) );
$user_can_edit = false;
foreach ( $show_ui_post_types as $pt ) {
	if ( current_user_can( $pt->cap->edit_posts ) ) {
		$user_can_edit = true;
		break;
	}
}
unset( $show_ui_post_types, $pt );
}}}

Taking it further, show_ui might not be the right check, since $user_can_edit is also used for comment moderation keyboard shortcuts. So perhaps we need two results, one that checks show_ui and post_type_supports (for editor), and another that simply checks whether any post type supports comments.",enhancement,new,normal,Future Release,Post Types,,normal,,,
