Changeset 12162 for trunk/wp-admin/includes/template.php
- Timestamp:
- 11/10/2009 10:38:19 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r12139 r12162 1445 1445 1446 1446 $actions = array(); 1447 if ('trash' == $post->post_status) { 1448 if ( current_user_can('delete_post', $post->ID) ) { 1447 if ( current_user_can('edit_post', $post->ID) && 'trash' != $post->post_status ) { 1448 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; 1449 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; 1450 } 1451 if ( current_user_can('delete_post', $post->ID) ) { 1452 if ( 'trash' == $post->post_status ) 1449 1453 $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; 1454 elseif ( EMPTY_TRASH_DAYS ) 1455 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; 1456 if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) 1450 1457 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; 1451 } 1452 } else { 1453 if ( current_user_can('edit_post', $post->ID) ) { 1454 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; 1455 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; 1456 } 1457 if ( current_user_can('delete_post', $post->ID) ) { 1458 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; 1459 } 1460 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1461 if ( current_user_can('edit_post', $post->ID) ) 1462 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1463 } else { 1464 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 1465 } 1458 } 1459 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1460 if ( current_user_can('edit_post', $post->ID) ) 1461 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1462 } elseif ( 'trash' != $post->post_status ) { 1463 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 1466 1464 } 1467 1465 $actions = apply_filters('post_row_actions', $actions, $post); … … 1667 1665 <?php 1668 1666 $actions = array(); 1669 if ($post->post_status == 'trash' && current_user_can('delete_page', $page->ID)) { 1670 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>"; 1671 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>"; 1672 } else { 1673 if ( current_user_can('edit_page', $page->ID) ) { 1674 $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 1675 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1676 } 1677 if ( current_user_can('delete_page', $page->ID) ) { 1667 if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) { 1668 $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 1669 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1670 } 1671 if ( current_user_can('delete_page', $page->ID) ) { 1672 if ( $post->post_status == 'trash' ) 1673 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>"; 1674 elseif ( EMPTY_TRASH_DAYS ) 1678 1675 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>"; 1679 } 1680 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1681 if ( current_user_can('edit_page', $page->ID) ) 1682 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1683 } else { 1684 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 1685 } 1676 if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS ) 1677 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>"; 1678 } 1679 if ( in_array($post->post_status, array('pending', 'draft')) ) { 1680 if ( current_user_can('edit_page', $page->ID) ) 1681 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 1682 } elseif ( $post->post_status != 'trash' ) { 1683 $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 1686 1684 } 1687 1685 $actions = apply_filters('page_row_actions', $actions, $page); … … 2180 2178 } 2181 2179 2182 if ( 'spam' == $the_comment_status ) { 2180 if ( 'spam' != $the_comment_status ) { 2181 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>'; 2182 } 2183 if ( 'spam' == $the_comment_status || !EMPTY_TRASH_DAYS ) { 2183 2184 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>'; 2184 2185 } else { 2185 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';2186 2186 $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>'; 2187 2187 }
Note: See TracChangeset
for help on using the changeset viewer.