Do proper caps check when processing bulk edited posts, and hide the checkbox on the Page edit page for users who lack permissions. props ocean90

git-svn-id: https://develop.svn.wordpress.org/trunk@15032 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2010-05-28 15:49:13 +00:00
parent 4078b8a301
commit cb6f66977e
2 changed files with 3 additions and 2 deletions

View File

@ -299,8 +299,9 @@ function bulk_edit_posts( $post_data = null ) {
$updated = $skipped = $locked = array();
foreach ( $post_IDs as $post_ID ) {
$post_type_object = get_post_type_object( get_post_type( $post_ID ) );
if ( isset($children) && in_array($post_ID, $children) ) {
if ( !isset( $post_type_object ) || ( isset($children) && in_array($post_ID, $children) ) || !current_user_can( $post_type_object->cap->edit_post, $post_ID ) ) {
$skipped[] = $post_ID;
continue;
}

View File

@ -1529,7 +1529,7 @@ foreach ( $posts_columns as $column_name => $column_display_name ) {
case 'cb':
?>
<th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /></th>
<th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>
<?php
break;
case 'date':