Changeset 12927 for trunk/wp-admin/edit.php
- Timestamp:
- 02/02/2010 05:37:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r12819 r12927 28 28 29 29 $post_type_object = get_post_type_object($post_type); 30 $post_type_cap = $post_type_object->capability_type;31 30 32 31 if ( 'post' != $post_type ) { … … 73 72 $trashed = 0; 74 73 foreach( (array) $post_ids as $post_id ) { 75 if ( !current_user_can( 'delete_' . $post_type_cap, $post_id) )74 if ( !current_user_can($post_type_object->delete_cap, $post_id) ) 76 75 wp_die( __('You are not allowed to move this item to the trash.') ); 77 76 … … 86 85 $untrashed = 0; 87 86 foreach( (array) $post_ids as $post_id ) { 88 if ( !current_user_can( 'delete_' . $post_type_cap, $post_id) )87 if ( !current_user_can($post_type_object->delete_cap, $post_id) ) 89 88 wp_die( __('You are not allowed to restore this item from the trash.') ); 90 89 … … 101 100 $post_del = & get_post($post_id); 102 101 103 if ( !current_user_can( 'delete_' . $post_type_cap, $post_id) )102 if ( !current_user_can($post_type_object->delete_cap, $post_id) ) 104 103 wp_die( __('You are not allowed to delete this item.') ); 105 104 … … 142 141 143 142 $user_posts = false; 144 if ( !current_user_can( 'edit_others_' . $post_type_cap . 's') ) {143 if ( !current_user_can($post_type_object->edit_others_cap) ) { 145 144 $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status != 'trash' AND post_author = %d", $post_type, $current_user->ID) ); 146 145 $user_posts = true; … … 342 341 <?php } 343 342 344 if ( $is_trash && current_user_can( 'edit_others_' . $post_type_cap .'s') ) { ?>343 if ( $is_trash && current_user_can($post_type_object->edit_others_cap) ) { ?> 345 344 <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" /> 346 345 <?php } ?> … … 389 388 </select> 390 389 <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 391 <?php if ( $is_trash && current_user_can( 'edit_others_' . $post_type_cap . 's') ) { ?>390 <?php if ( $is_trash && current_user_can($post_type_object->edit_others_cap) ) { ?> 392 391 <input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" /> 393 392 <?php } ?>
Note: See TracChangeset
for help on using the changeset viewer.