Changeset 14585 for trunk/wp-admin/includes/template.php
- Timestamp:
- 05/12/2010 08:45:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r14571 r14585 877 877 $col_count = count($columns) - count($hidden); 878 878 $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list'; 879 $can_publish = current_user_can($post_type_object-> publish_cap);879 $can_publish = current_user_can($post_type_object->cap->publish_posts); 880 880 $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true ); 881 881 … … 1112 1112 </label> 1113 1113 1114 <?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object-> edit_others_cap) ) : ?>1114 <?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_other_posts ) ) : ?> 1115 1115 1116 1116 <?php if ( $bulk ) : ?> … … 1182 1182 function get_inline_data($post) { 1183 1183 $post_type_object = get_post_type_object($post->post_type); 1184 if ( ! current_user_can($post_type_object-> edit_cap, $post->ID) )1184 if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) ) 1185 1185 return; 1186 1186 … … 1299 1299 case 'cb': 1300 1300 ?> 1301 <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object-> edit_cap, $post->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>1301 <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $post->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th> 1302 1302 <?php 1303 1303 break; … … 1342 1342 $attributes = 'class="post-title column-title"' . $style; 1343 1343 ?> 1344 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object-> edit_cap, $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>1344 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong> 1345 1345 <?php 1346 1346 if ( 'excerpt' == $mode ) … … 1348 1348 1349 1349 $actions = array(); 1350 if ( current_user_can($post_type_object-> edit_cap, $post->ID) && 'trash' != $post->post_status ) {1350 if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && 'trash' != $post->post_status ) { 1351 1351 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; 1352 1352 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; 1353 1353 } 1354 if ( current_user_can($post_type_object-> delete_cap, $post->ID) ) {1354 if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { 1355 1355 if ( 'trash' == $post->post_status ) 1356 1356 $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url( admin_url( sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Restore') . "</a>"; … … 1361 1361 } 1362 1362 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1363 if ( current_user_can($post_type_object-> edit_cap, $post->ID) )1363 if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) 1364 1364 $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($post->ID) ) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1365 1365 } elseif ( 'trash' != $post->post_status ) { … … 1444 1444 case 'control_edit': 1445 1445 ?> 1446 <td><?php if ( current_user_can($post_type_object-> edit_cap, $post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>1446 <td><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td> 1447 1447 <?php 1448 1448 break; … … 1450 1450 case 'control_delete': 1451 1451 ?> 1452 <td><?php if ( current_user_can($post_type_object-> delete_cap, $post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>1452 <td><?php if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td> 1453 1453 <?php 1454 1454 break; … … 1567 1567 $edit_link = get_edit_post_link( $page->ID ); 1568 1568 ?> 1569 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object-> edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent . ' ' . esc_html($parent_name) : ''; ?></strong>1569 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent . ' ' . esc_html($parent_name) : ''; ?></strong> 1570 1570 <?php 1571 1571 $actions = array(); 1572 if ( current_user_can($post_type_object-> edit_cap, $page->ID) && $post->post_status != 'trash' ) {1572 if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { 1573 1573 $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 1574 1574 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1575 1575 } 1576 if ( current_user_can($post_type_object-> delete_cap, $page->ID) ) {1576 if ( current_user_can($post_type_object->cap->delete_post, $page->ID) ) { 1577 1577 if ( $post->post_status == 'trash' ) 1578 1578 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=untrash&post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . "</a>"; … … 1583 1583 } 1584 1584 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1585 if ( current_user_can($post_type_object-> edit_cap, $page->ID) )1585 if ( current_user_can($post_type_object->cap->edit_post, $page->ID) ) 1586 1586 $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($page->ID) ) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1587 1587 } elseif ( $post->post_status != 'trash' ) { … … 2011 2011 $the_comment_status = wp_get_comment_status($comment->comment_ID); 2012 2012 $post_type_object = get_post_type_object($post->post_type); 2013 $user_can = current_user_can($post_type_object-> edit_cap, $post->ID);2013 $user_can = current_user_can($post_type_object->cap->edit_post, $post->ID); 2014 2014 2015 2015 $comment_url = esc_url(get_comment_link($comment->comment_ID)); … … 3329 3329 switch ( $screen->id ) { 3330 3330 case $post_type_object->name: 3331 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object-> edit_type_cap));3331 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object->cap->edit_posts)); 3332 3332 break; 3333 3333 case "edit-{$post_type_object->name}": 3334 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object-> edit_type_cap));3334 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts)); 3335 3335 break; 3336 3336 }
Note: See TracChangeset
for help on using the changeset viewer.