Make WordPress Core


Ignore:
Timestamp:
02/24/2010 05:43:41 AM (15 years ago)
Author:
ryan
Message:

Fix trash/untrash/delete links for custom post types. Props jfarthing84. see #9674

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r13316 r13359  
    13601360            if ( current_user_can($post_type_object->delete_cap, $post->ID) ) {
    13611361                if ( 'trash' == $post->post_status )
    1362                     $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
     1362                    $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url( admin_url( sprintf($post_type_object->_edit_link . '&amp;action=untrash', $post->ID) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Restore') . "</a>";
    13631363                elseif ( EMPTY_TRASH_DAYS )
    13641364                    $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
    13651365                if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
    1366                     $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
     1366                    $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url( admin_url( sprintf($post_type_object->_edit_link . '&amp;action=delete', $post->ID) ), 'delete-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Delete Permanently') . "</a>";
    13671367            }
    13681368            if ( in_array($post->post_status, array('pending', 'draft')) ) {
Note: See TracChangeset for help on using the changeset viewer.