Changeset 13786
- Timestamp:
- 03/21/2010 02:29:11 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/includes/meta-boxes.php (modified) (3 diffs)
-
wp-admin/includes/template.php (modified) (3 diffs)
-
wp-includes/capabilities.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/meta-boxes.php
r13778 r13786 15 15 $post_type = $post->post_type; 16 16 $post_type_object = get_post_type_object($post_type); 17 $type_cap = $post_type_object->capability_type; 18 $can_publish = current_user_can("publish_${type_cap}s"); 17 $can_publish = current_user_can($post_type_object->publish_cap); 19 18 ?> 20 19 <div class="submitbox" id="submitpost"> … … 195 194 <div id="delete-action"> 196 195 <?php 197 if ( current_user_can( "delete_ ${type_cap}", $post->ID ) ) {196 if ( current_user_can( "delete_post", $post->ID ) ) { 198 197 if ( !EMPTY_TRASH_DAYS ) { 199 198 $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" ); … … 408 407 409 408 /** 410 * Displa comments for post table header409 * Display comments for post table header 411 410 * 412 411 * @since 3.0 -
trunk/wp-admin/includes/template.php
r13779 r13786 864 864 $taxonomy = get_taxonomy( $taxonomy_name); 865 865 866 if( !$taxonomy->show_ui ) continue; 867 868 if( $taxonomy->hierarchical ) 866 if ( !$taxonomy->show_ui ) 867 continue; 868 869 if ( $taxonomy->hierarchical ) 869 870 $hierarchical_taxonomies[] = $taxonomy; 870 871 else … … 876 877 $col_count = count($columns) - count($hidden); 877 878 $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list'; 878 // @todo use capability_type879 879 $can_publish = current_user_can($post_type_object->publish_cap); 880 880 $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true ); … … 1562 1562 if ( current_user_can($post_type_object->delete_cap, $page->ID) ) { 1563 1563 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&action=untrash&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&action=untrash&post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . "</a>"; 1565 1565 elseif ( EMPTY_TRASH_DAYS ) 1566 1566 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>"; 1567 1567 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&action=delete&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&action=delete&post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>"; 1569 1569 } 1570 1570 if ( in_array($post->post_status, array('pending', 'draft')) ) { -
trunk/wp-includes/capabilities.php
r13784 r13786 811 811 $post_type = get_post_type_object( $post->post_type ); 812 812 if ( $post_type && 'post' != $post_type->capability_type ) { 813 $args = array_merge( array( 'delete_' . $post_type->capability_type, $user_id ), $args );813 $args = array_merge( array( $post_type->delete_cap, $user_id ), $args ); 814 814 return call_user_func_array( 'map_meta_cap', $args ); 815 815 } … … 888 888 $post_type = get_post_type_object( $post->post_type ); 889 889 if ( $post_type && 'post' != $post_type->capability_type ) { 890 $args = array_merge( array( 'edit_' . $post_type->capability_type, $user_id ), $args );890 $args = array_merge( array( $post_type->edit_cap, $user_id ), $args ); 891 891 return call_user_func_array( 'map_meta_cap', $args ); 892 892 } … … 947 947 $post_type = get_post_type_object( $post->post_type ); 948 948 if ( $post_type && 'post' != $post_type->capability_type ) { 949 $args = array_merge( array( 'read_' . $post_type->capability_type, $user_id ), $args );949 $args = array_merge( array( $post_type->read_cap, $user_id ), $args ); 950 950 return call_user_func_array( 'map_meta_cap', $args ); 951 951 }
Note: See TracChangeset
for help on using the changeset viewer.