Make WordPress Core


Ignore:
Timestamp:
03/21/2010 02:29:11 AM (16 years ago)
Author:
dd32
Message:

Use correct cap checks and nonces for custom post_type's

File:
1 edited

Legend:

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

    r13779 r13786  
    864864                $taxonomy = get_taxonomy( $taxonomy_name);
    865865
    866                 if( !$taxonomy->show_ui ) continue;
    867 
    868                 if( $taxonomy->hierarchical )
     866                if ( !$taxonomy->show_ui )
     867                        continue;
     868
     869                if ( $taxonomy->hierarchical )
    869870                        $hierarchical_taxonomies[] = $taxonomy;
    870871                else
     
    876877        $col_count = count($columns) - count($hidden);
    877878        $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
    878         // @todo use capability_type
    879879        $can_publish = current_user_can($post_type_object->publish_cap);
    880880        $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true );
     
    15621562                if ( current_user_can($post_type_object->delete_cap, $page->ID) ) {
    15631563                        if ( $post->post_status == 'trash' )
    1564                                 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=untrash&amp;post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
     1564                                $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=untrash&amp;post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . "</a>";
    15651565                        elseif ( EMPTY_TRASH_DAYS )
    15661566                                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
    15671567                        if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
    1568                                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
     1568                                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=delete&amp;post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
    15691569                }
    15701570                if ( in_array($post->post_status, array('pending', 'draft')) ) {
Note: See TracChangeset for help on using the changeset viewer.