<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14585] trunk: Move post type object capabilities to a 'cap' object.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14585">14585</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-12 20:45:18 +0000 (Wed, 12 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move post type object capabilities to a 'cap' object. Allow them to be initialized via the 'capabilities' key (an array) when registering support for the post type. Caps are now referred to by the name of the cap as if it was a post, i.e. -&gt;cap-&gt;edit_post. see <a href="http://trac.wordpress.org/ticket/13358">#13358</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmineditformadvancedphp">trunk/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunkwpadmineditphp">trunk/wp-admin/edit.php</a></li>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminincludesuserphp">trunk/wp-admin/includes/user.php</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
<li><a href="#trunkwpadminpostnewphp">trunk/wp-admin/post-new.php</a></li>
<li><a href="#trunkwpadminpostphp">trunk/wp-admin/post.php</a></li>
<li><a href="#trunkwpincludescapabilitiesphp">trunk/wp-includes/capabilities.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludesqueryphp">trunk/wp-includes/query.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/edit-form-advanced.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> if ( ('publish' == $post-&gt;post_status || 'private' == $post-&gt;post_status) &amp;&amp; post_type_supports($post_type, 'comments') )
</span><span class="cx">         add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', $post_type, 'normal', 'core');
</span><span class="cx"> 
</span><del>-if ( !( 'pending' == $post-&gt;post_status &amp;&amp; !current_user_can( $post_type_object-&gt;publish_cap ) ) )
</del><ins>+if ( !( 'pending' == $post-&gt;post_status &amp;&amp; !current_user_can( $post_type_object-&gt;cap-&gt;publish_posts ) ) )
</ins><span class="cx">         add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', $post_type, 'normal', 'core');
</span><span class="cx"> 
</span><span class="cx"> if ( post_type_supports($post_type, 'author') ) {
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx"> if ( !empty($shortlink) )
</span><span class="cx">     $sample_permalink_html .= '&lt;input id=&quot;shortlink&quot; type=&quot;hidden&quot; value=&quot;' . esc_attr($shortlink) . '&quot; /&gt;&lt;a href=&quot;#&quot; class=&quot;button&quot; onclick=&quot;prompt(&amp;#39;URL:&amp;#39;, jQuery(\'#shortlink\').val()); return false;&quot;&gt;' . __('Get Shortlink') . '&lt;/a&gt;';
</span><span class="cx"> 
</span><del>-if ( !( 'pending' == $post-&gt;post_status &amp;&amp; !current_user_can( $post_type_object-&gt;publish_cap ) ) ) { ?&gt;
</del><ins>+if ( !( 'pending' == $post-&gt;post_status &amp;&amp; !current_user_can( $post_type_object-&gt;cap-&gt;publish_posts ) ) ) { ?&gt;
</ins><span class="cx">         &lt;div id=&quot;edit-slug-box&quot;&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">                 if ( ! empty($post-&gt;ID) &amp;&amp; ! empty($sample_permalink_html) &amp;&amp; 'auto-draft' != $post-&gt;post_status )
</span></span></pre></div>
<a id="trunkwpadmineditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/edit.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> 
</span><span class="cx"> $post_type_object = get_post_type_object($post_type);
</span><span class="cx"> 
</span><del>-if ( !current_user_can($post_type_object-&gt;edit_type_cap) )
</del><ins>+if ( !current_user_can($post_type_object-&gt;cap-&gt;edit_posts) )
</ins><span class="cx">         wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><span class="cx"> // Back-compat for viewing comments of an entry
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">                 case 'trash':
</span><span class="cx">                         $trashed = 0;
</span><span class="cx">                         foreach( (array) $post_ids as $post_id ) {
</span><del>-                                if ( !current_user_can($post_type_object-&gt;delete_cap, $post_id) )
</del><ins>+                                if ( !current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post_id) )
</ins><span class="cx">                                         wp_die( __('You are not allowed to move this item to the Trash.') );
</span><span class="cx"> 
</span><span class="cx">                                 if ( !wp_trash_post($post_id) )
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">                 case 'untrash':
</span><span class="cx">                         $untrashed = 0;
</span><span class="cx">                         foreach( (array) $post_ids as $post_id ) {
</span><del>-                                if ( !current_user_can($post_type_object-&gt;delete_cap, $post_id) )
</del><ins>+                                if ( !current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post_id) )
</ins><span class="cx">                                         wp_die( __('You are not allowed to restore this item from the Trash.') );
</span><span class="cx"> 
</span><span class="cx">                                 if ( !wp_untrash_post($post_id) )
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">                         foreach( (array) $post_ids as $post_id ) {
</span><span class="cx">                                 $post_del = &amp; get_post($post_id);
</span><span class="cx"> 
</span><del>-                                if ( !current_user_can($post_type_object-&gt;delete_cap, $post_id) )
</del><ins>+                                if ( !current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post_id) )
</ins><span class="cx">                                         wp_die( __('You are not allowed to delete this item.') );
</span><span class="cx"> 
</span><span class="cx">                                 if ( $post_del-&gt;post_type == 'attachment' ) {
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> wp_enqueue_script('inline-edit-post');
</span><span class="cx"> 
</span><span class="cx"> $user_posts = false;
</span><del>-if ( !current_user_can($post_type_object-&gt;edit_others_cap) ) {
</del><ins>+if ( !current_user_can($post_type_object-&gt;cap-&gt;edit_other_posts) ) {
</ins><span class="cx">         $user_posts_count = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT COUNT(1) FROM $wpdb-&gt;posts WHERE post_type = '%s' AND post_status NOT IN ('trash', 'auto-draft') AND post_author = %d&quot;, $post_type, $current_user-&gt;ID) );
</span><span class="cx">         $user_posts = true;
</span><span class="cx">         if ( $user_posts_count &amp;&amp; empty($_GET['post_status']) &amp;&amp; empty($_GET['all_posts']) &amp;&amp; empty($_GET['author']) )
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx"> &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e('Filter'); ?&gt;&quot; class=&quot;button-secondary&quot; /&gt;
</span><span class="cx"> &lt;?php }
</span><span class="cx"> 
</span><del>-if ( $is_trash &amp;&amp; current_user_can($post_type_object-&gt;edit_others_cap) ) { ?&gt;
</del><ins>+if ( $is_trash &amp;&amp; current_user_can($post_type_object-&gt;cap-&gt;edit_other_posts) ) { ?&gt;
</ins><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;delete_all&quot; id=&quot;delete_all&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="lines">@@ -396,7 +396,7 @@
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><span class="cx"> &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Apply'); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
</span><del>-&lt;?php if ( $is_trash &amp;&amp; current_user_can($post_type_object-&gt;edit_others_cap) ) { ?&gt;
</del><ins>+&lt;?php if ( $is_trash &amp;&amp; current_user_can($post_type_object-&gt;cap-&gt;edit_other_posts) ) { ?&gt;
</ins><span class="cx"> &lt;input type=&quot;submit&quot; name=&quot;delete_all2&quot; id=&quot;delete_all2&quot; value=&quot;&lt;?php esc_attr_e('Empty Trash'); ?&gt;&quot; class=&quot;button-secondary apply&quot; /&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;br class=&quot;clear&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/includes/meta-boxes.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> 
</span><span class="cx">         $post_type = $post-&gt;post_type;
</span><span class="cx">         $post_type_object = get_post_type_object($post_type);
</span><del>-        $can_publish = current_user_can($post_type_object-&gt;publish_cap);
</del><ins>+        $can_publish = current_user_can($post_type_object-&gt;cap-&gt;publish_posts);
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;submitbox&quot; id=&quot;submitpost&quot;&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/includes/post.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> 
</span><span class="cx">         $ptype = get_post_type_object( $post_data['post_type'] );
</span><span class="cx">         if ( isset($post_data['user_ID']) &amp;&amp; ($post_data['post_author'] != $post_data['user_ID']) ) {
</span><del>-                if ( !current_user_can( $ptype-&gt;edit_others_cap ) ) {
</del><ins>+                if ( !current_user_can( $ptype-&gt;cap-&gt;edit_other_posts ) ) {
</ins><span class="cx">                         if ( 'page' == $post_data['post_type'] ) {
</span><span class="cx">                                 return new WP_Error( 'edit_others_pages', $update ?
</span><span class="cx">                                         __( 'You are not allowed to edit pages as this user.' ) :
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
</span><span class="cx">         // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
</span><del>-        if ( isset($post_data['post_status']) &amp;&amp; ('publish' == $post_data['post_status'] &amp;&amp; !current_user_can( $ptype-&gt;publish_cap )) )
</del><ins>+        if ( isset($post_data['post_status']) &amp;&amp; ('publish' == $post_data['post_status'] &amp;&amp; !current_user_can( $ptype-&gt;cap-&gt;publish_posts )) )
</ins><span class="cx">                 if ( $previous_status != 'publish' || !current_user_can( 'edit_post', $post_id ) )
</span><span class="cx">                         $post_data['post_status'] = 'pending';
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">         $post_ID = (int) $post_data['post_ID'];
</span><span class="cx"> 
</span><span class="cx">         $ptype = get_post_type_object($post_data['post_type']);
</span><del>-        if ( !current_user_can( $ptype-&gt;edit_cap, $post_ID ) ) {
</del><ins>+        if ( !current_user_can( $ptype-&gt;cap-&gt;edit_post, $post_ID ) ) {
</ins><span class="cx">                 if ( 'page' == $post_data['post_type'] )
</span><span class="cx">                         wp_die( __('You are not allowed to edit this page.' ));
</span><span class="cx">                 else
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">         else
</span><span class="cx">                 $ptype = get_post_type_object('post');
</span><span class="cx"> 
</span><del>-        if ( !current_user_can( $ptype-&gt;edit_type_cap ) ) {
</del><ins>+        if ( !current_user_can( $ptype-&gt;cap-&gt;edit_posts ) ) {
</ins><span class="cx">                 if ( 'page' == $ptype-&gt;name )
</span><span class="cx">                         wp_die( __('You are not allowed to edit pages.'));
</span><span class="cx">                 else
</span><span class="lines">@@ -494,7 +494,7 @@
</span><span class="cx">         else
</span><span class="cx">                 $ptype = get_post_type_object('post');
</span><span class="cx"> 
</span><del>-        if ( !current_user_can( $ptype-&gt;edit_type_cap ) ) {
</del><ins>+        if ( !current_user_can( $ptype-&gt;cap-&gt;edit_posts ) ) {
</ins><span class="cx">                 if ( 'page' == $ptype-&gt;name )
</span><span class="cx">                         return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this site.' ) );
</span><span class="cx">                 else
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/includes/template.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -876,7 +876,7 @@
</span><span class="cx">         $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
</span><span class="cx">         $col_count = count($columns) - count($hidden);
</span><span class="cx">         $m = ( isset($mode) &amp;&amp; 'excerpt' == $mode ) ? 'excerpt' : 'list';
</span><del>-        $can_publish = current_user_can($post_type_object-&gt;publish_cap);
</del><ins>+        $can_publish = current_user_can($post_type_object-&gt;cap-&gt;publish_posts);
</ins><span class="cx">         $core_columns = array( 'cb' =&gt; true, 'date' =&gt; true, 'title' =&gt; true, 'categories' =&gt; true, 'tags' =&gt; true, 'comments' =&gt; true, 'author' =&gt; true );
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="lines">@@ -1111,7 +1111,7 @@
</span><span class="cx">                                 &lt;/select&gt;
</span><span class="cx">                         &lt;/label&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( 'post' == $screen-&gt;post_type &amp;&amp; $can_publish &amp;&amp; current_user_can( $post_type_object-&gt;edit_others_cap ) ) : ?&gt;
</del><ins>+&lt;?php if ( 'post' == $screen-&gt;post_type &amp;&amp; $can_publish &amp;&amp; current_user_can( $post_type_object-&gt;cap-&gt;edit_other_posts ) ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;?php        if ( $bulk ) : ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1181,7 +1181,7 @@
</span><span class="cx">  */
</span><span class="cx"> function get_inline_data($post) {
</span><span class="cx">         $post_type_object = get_post_type_object($post-&gt;post_type);
</span><del>-        if ( ! current_user_can($post_type_object-&gt;edit_cap, $post-&gt;ID) )
</del><ins>+        if ( ! current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         $title = esc_attr( get_the_title( $post-&gt;ID ) );
</span><span class="lines">@@ -1298,7 +1298,7 @@
</span><span class="cx"> 
</span><span class="cx">                 case 'cb':
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can( $post_type_object-&gt;edit_cap, $post-&gt;ID ) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;post[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/th&gt;
</del><ins>+                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;&lt;?php if ( current_user_can( $post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID ) ) { ?&gt;&lt;input type=&quot;checkbox&quot; name=&quot;post[]&quot; value=&quot;&lt;?php the_ID(); ?&gt;&quot; /&gt;&lt;?php } ?&gt;&lt;/th&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="lines">@@ -1341,17 +1341,17 @@
</span><span class="cx">                 case 'title':
</span><span class="cx">                         $attributes = 'class=&quot;post-title column-title&quot;' . $style;
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can($post_type_object-&gt;edit_cap, $post-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $title; }; _post_states($post); ?&gt;&lt;/strong&gt;
</del><ins>+                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $title; }; _post_states($post); ?&gt;&lt;/strong&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                         if ( 'excerpt' == $mode )
</span><span class="cx">                                 the_excerpt();
</span><span class="cx"> 
</span><span class="cx">                         $actions = array();
</span><del>-                        if ( current_user_can($post_type_object-&gt;edit_cap, $post-&gt;ID) &amp;&amp; 'trash' != $post-&gt;post_status ) {
</del><ins>+                        if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID) &amp;&amp; 'trash' != $post-&gt;post_status ) {
</ins><span class="cx">                                 $actions['edit'] = '&lt;a href=&quot;' . get_edit_post_link($post-&gt;ID, true) . '&quot; title=&quot;' . esc_attr(__('Edit this post')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span><span class="cx">                                 $actions['inline hide-if-no-js'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot; title=&quot;' . esc_attr(__('Edit this post inline')) . '&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
</span><span class="cx">                         }
</span><del>-                        if ( current_user_can($post_type_object-&gt;delete_cap, $post-&gt;ID) ) {
</del><ins>+                        if ( current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post-&gt;ID) ) {
</ins><span class="cx">                                 if ( 'trash' == $post-&gt;post_status )
</span><span class="cx">                                         $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr(__('Restore this post from the Trash')) . &quot;' href='&quot; . wp_nonce_url( admin_url( sprintf($post_type_object-&gt;_edit_link . '&amp;amp;action=untrash', $post-&gt;ID) ), 'untrash-' . $post-&gt;post_type . '_' . $post-&gt;ID ) . &quot;'&gt;&quot; . __('Restore') . &quot;&lt;/a&gt;&quot;;
</span><span class="cx">                                 elseif ( EMPTY_TRASH_DAYS )
</span><span class="lines">@@ -1360,7 +1360,7 @@
</span><span class="cx">                                         $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Delete this post permanently')) . &quot;' href='&quot; . get_delete_post_link($post-&gt;ID, '', true) . &quot;'&gt;&quot; . __('Delete Permanently') . &quot;&lt;/a&gt;&quot;;
</span><span class="cx">                         }
</span><span class="cx">                         if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
</span><del>-                                if ( current_user_can($post_type_object-&gt;edit_cap, $post-&gt;ID) )
</del><ins>+                                if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID) )
</ins><span class="cx">                                         $actions['view'] = '&lt;a href=&quot;' . add_query_arg( 'preview', 'true', get_permalink($post-&gt;ID) ) . '&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</span><span class="cx">                         } elseif ( 'trash' != $post-&gt;post_status ) {
</span><span class="cx">                                 $actions['view'] = '&lt;a href=&quot;' . get_permalink($post-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
</span><span class="lines">@@ -1443,13 +1443,13 @@
</span><span class="cx"> 
</span><span class="cx">                 case 'control_edit':
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td&gt;&lt;?php if ( current_user_can($post_type_object-&gt;edit_cap, $post-&gt;ID) ) { echo &quot;&lt;a href='$edit_link' class='edit'&gt;&quot; . __('Edit') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
</del><ins>+                &lt;td&gt;&lt;?php if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID) ) { echo &quot;&lt;a href='$edit_link' class='edit'&gt;&quot; . __('Edit') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">                 case 'control_delete':
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td&gt;&lt;?php if ( current_user_can($post_type_object-&gt;delete_cap, $post-&gt;ID) ) { echo &quot;&lt;a href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$id&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' class='delete'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
</del><ins>+                &lt;td&gt;&lt;?php if ( current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post-&gt;ID) ) { echo &quot;&lt;a href='&quot; . wp_nonce_url(&quot;post.php?action=delete&amp;amp;post=$id&quot;, 'delete-post_' . $post-&gt;ID) . &quot;' class='delete'&gt;&quot; . __('Delete') . &quot;&lt;/a&gt;&quot;; } ?&gt;&lt;/td&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="lines">@@ -1566,14 +1566,14 @@
</span><span class="cx">                 $attributes = 'class=&quot;post-title page-title column-title&quot;' . $style;
</span><span class="cx">                 $edit_link = get_edit_post_link( $page-&gt;ID );
</span><span class="cx">                 ?&gt;
</span><del>-                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can($post_type_object-&gt;edit_cap, $page-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object-&gt;labels-&gt;parent . ' ' . esc_html($parent_name) : ''; ?&gt;&lt;/strong&gt;
</del><ins>+                &lt;td &lt;?php echo $attributes ?&gt;&gt;&lt;strong&gt;&lt;?php if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $page-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) { ?&gt;&lt;a class=&quot;row-title&quot; href=&quot;&lt;?php echo $edit_link; ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(sprintf(__('Edit &amp;#8220;%s&amp;#8221;'), $title)); ?&gt;&quot;&gt;&lt;?php echo $pad; echo $title ?&gt;&lt;/a&gt;&lt;?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object-&gt;labels-&gt;parent . ' ' . esc_html($parent_name) : ''; ?&gt;&lt;/strong&gt;
</ins><span class="cx">                 &lt;?php
</span><span class="cx">                 $actions = array();
</span><del>-                if ( current_user_can($post_type_object-&gt;edit_cap, $page-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) {
</del><ins>+                if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $page-&gt;ID) &amp;&amp; $post-&gt;post_status != 'trash' ) {
</ins><span class="cx">                         $actions['edit'] = '&lt;a href=&quot;' . $edit_link . '&quot; title=&quot;' . esc_attr(__('Edit this page')) . '&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span><span class="cx">                         $actions['inline'] = '&lt;a href=&quot;#&quot; class=&quot;editinline&quot;&gt;' . __('Quick&amp;nbsp;Edit') . '&lt;/a&gt;';
</span><span class="cx">                 }
</span><del>-                if ( current_user_can($post_type_object-&gt;delete_cap, $page-&gt;ID) ) {
</del><ins>+                if ( current_user_can($post_type_object-&gt;cap-&gt;delete_post, $page-&gt;ID) ) {
</ins><span class="cx">                         if ( $post-&gt;post_status == 'trash' )
</span><span class="cx">                                 $actions['untrash'] = &quot;&lt;a title='&quot; . esc_attr(__('Remove this page from the Trash')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?post_type=$post_type&amp;amp;action=untrash&amp;amp;post=$page-&gt;ID&quot;, 'untrash-' . $post-&gt;post_type . '_' . $page-&gt;ID) . &quot;'&gt;&quot; . __('Restore') . &quot;&lt;/a&gt;&quot;;
</span><span class="cx">                         elseif ( EMPTY_TRASH_DAYS )
</span><span class="lines">@@ -1582,7 +1582,7 @@
</span><span class="cx">                                 $actions['delete'] = &quot;&lt;a class='submitdelete' title='&quot; . esc_attr(__('Delete this page permanently')) . &quot;' href='&quot; . wp_nonce_url(&quot;post.php?post_type=$post_type&amp;amp;action=delete&amp;amp;post=$page-&gt;ID&quot;, 'delete-' . $post-&gt;post_type . '_' . $page-&gt;ID) . &quot;'&gt;&quot; . __('Delete Permanently') . &quot;&lt;/a&gt;&quot;;
</span><span class="cx">                 }
</span><span class="cx">                 if ( in_array($post-&gt;post_status, array('pending', 'draft')) ) {
</span><del>-                        if ( current_user_can($post_type_object-&gt;edit_cap, $page-&gt;ID) )
</del><ins>+                        if ( current_user_can($post_type_object-&gt;cap-&gt;edit_post, $page-&gt;ID) )
</ins><span class="cx">                                 $actions['view'] = '&lt;a href=&quot;' . add_query_arg( 'preview', 'true', get_permalink($page-&gt;ID) ) . '&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
</span><span class="cx">                 } elseif ( $post-&gt;post_status != 'trash' ) {
</span><span class="cx">                         $actions['view'] = '&lt;a href=&quot;' . get_permalink($page-&gt;ID) . '&quot; title=&quot;' . esc_attr(sprintf(__('View &amp;#8220;%s&amp;#8221;'), $title)) . '&quot; rel=&quot;permalink&quot;&gt;' . __('View') . '&lt;/a&gt;';
</span><span class="lines">@@ -2010,7 +2010,7 @@
</span><span class="cx">         $post = get_post($comment-&gt;comment_post_ID);
</span><span class="cx">         $the_comment_status = wp_get_comment_status($comment-&gt;comment_ID);
</span><span class="cx">         $post_type_object = get_post_type_object($post-&gt;post_type);
</span><del>-        $user_can = current_user_can($post_type_object-&gt;edit_cap, $post-&gt;ID);
</del><ins>+        $user_can = current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID);
</ins><span class="cx"> 
</span><span class="cx">         $comment_url = esc_url(get_comment_link($comment-&gt;comment_ID));
</span><span class="cx">         $author_url = get_comment_author_url();
</span><span class="lines">@@ -3328,10 +3328,10 @@
</span><span class="cx">         if ( isset($post_type_object) ) {
</span><span class="cx">                 switch ( $screen-&gt;id ) {
</span><span class="cx">                         case $post_type_object-&gt;name:
</span><del>-                                $default_action = array('edit.php?post_type=' . $post_type_object-&gt;name =&gt; array($post_type_object-&gt;labels-&gt;edit_item, $post_type_object-&gt;edit_type_cap));
</del><ins>+                                $default_action = array('edit.php?post_type=' . $post_type_object-&gt;name =&gt; array($post_type_object-&gt;labels-&gt;edit_item, $post_type_object-&gt;cap-&gt;edit_posts));
</ins><span class="cx">                                 break;
</span><span class="cx">                         case &quot;edit-{$post_type_object-&gt;name}&quot;:
</span><del>-                                $default_action = array('post-new.php?post_type=' . $post_type_object-&gt;name =&gt; array($post_type_object-&gt;labels-&gt;new_item, $post_type_object-&gt;edit_type_cap));
</del><ins>+                                $default_action = array('post-new.php?post_type=' . $post_type_object-&gt;name =&gt; array($post_type_object-&gt;labels-&gt;new_item, $post_type_object-&gt;cap-&gt;edit_posts));
</ins><span class="cx">                                 break;
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpadminincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/user.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/user.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/includes/user.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -249,8 +249,8 @@
</span><span class="cx">         $user = new WP_User( $user_id );
</span><span class="cx">         $post_type_obj = get_post_type_object($post_type);
</span><span class="cx"> 
</span><del>-        if ( ! $user-&gt;has_cap($post_type_obj-&gt;edit_others_cap) ) {
-                if ( $user-&gt;has_cap($post_type_obj-&gt;edit_type_cap) || ! $exclude_zeros )
</del><ins>+        if ( ! $user-&gt;has_cap($post_type_obj-&gt;cap-&gt;edit_other_posts) ) {
+                if ( $user-&gt;has_cap($post_type_obj-&gt;cap-&gt;edit_posts) || ! $exclude_zeros )
</ins><span class="cx">                         return array($user-&gt;id);
</span><span class="cx">                 else
</span><span class="cx">                         return array();
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/menu.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -129,9 +129,9 @@
</span><span class="cx">         while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) )
</span><span class="cx">                 $ptype_menu_position++;
</span><span class="cx"> 
</span><del>-        $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj-&gt;labels-&gt;name ), $ptype_obj-&gt;edit_type_cap, &quot;edit.php?post_type=$ptype&quot;, '', 'menu-top menu-icon-' . $ptype_class, 'menu-' . $ptype_class, $menu_icon );
-        $submenu[&quot;edit.php?post_type=$ptype&quot;][5]  = array( $ptype_obj-&gt;labels-&gt;edit, $ptype_obj-&gt;edit_type_cap,  &quot;edit.php?post_type=$ptype&quot;);
-        $submenu[&quot;edit.php?post_type=$ptype&quot;][10]  = array( $ptype_obj-&gt;labels-&gt;add_new, $ptype_obj-&gt;edit_type_cap, &quot;post-new.php?post_type=$ptype&quot; );
</del><ins>+        $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj-&gt;labels-&gt;name ), $ptype_obj-&gt;cap-&gt;edit_posts, &quot;edit.php?post_type=$ptype&quot;, '', 'menu-top menu-icon-' . $ptype_class, 'menu-' . $ptype_class, $menu_icon );
+        $submenu[&quot;edit.php?post_type=$ptype&quot;][5]  = array( $ptype_obj-&gt;labels-&gt;edit, $ptype_obj-&gt;cap-&gt;edit_posts,  &quot;edit.php?post_type=$ptype&quot;);
+        $submenu[&quot;edit.php?post_type=$ptype&quot;][10]  = array( $ptype_obj-&gt;labels-&gt;add_new, $ptype_obj-&gt;cap-&gt;edit_posts, &quot;post-new.php?post_type=$ptype&quot; );
</ins><span class="cx"> 
</span><span class="cx">         $i = 15;
</span><span class="cx">         foreach ( $wp_taxonomies as $tax ) {
</span></span></pre></div>
<a id="trunkwpadminpostnewphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post-new.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post-new.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/post-new.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> wp_enqueue_script('autosave');
</span><span class="cx"> 
</span><span class="cx"> // Show post form.
</span><del>-if ( current_user_can($post_type_object-&gt;edit_type_cap) ) {
</del><ins>+if ( current_user_can($post_type_object-&gt;cap-&gt;edit_posts) ) {
</ins><span class="cx">         $post = get_default_post_to_edit( $post_type, true );
</span><span class="cx">         $post_ID = $post-&gt;ID;
</span><span class="cx">         include('edit-form-advanced.php');
</span></span></pre></div>
<a id="trunkwpadminpostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-admin/post.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">         if ( empty($post-&gt;ID) )
</span><span class="cx">                 wp_die( __('You attempted to edit an item that doesn&amp;#8217;t exist. Perhaps it was deleted?') );
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($post_type_object-&gt;edit_cap, $post_id) )
</del><ins>+        if ( !current_user_can($post_type_object-&gt;cap-&gt;edit_post, $post_id) )
</ins><span class="cx">                 wp_die( __('You are not allowed to edit this item.') );
</span><span class="cx"> 
</span><span class="cx">         if ( 'trash' == $post-&gt;post_status )
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx"> 
</span><span class="cx">         $post = &amp; get_post($post_id);
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($post_type_object-&gt;delete_cap, $post_id) )
</del><ins>+        if ( !current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post_id) )
</ins><span class="cx">                 wp_die( __('You are not allowed to move this item to the Trash.') );
</span><span class="cx"> 
</span><span class="cx">         if ( ! wp_trash_post($post_id) )
</span><span class="lines">@@ -230,7 +230,7 @@
</span><span class="cx"> case 'untrash':
</span><span class="cx">         check_admin_referer('untrash-' . $post_type . '_' . $post_id);
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($post_type_object-&gt;delete_cap, $post_id) )
</del><ins>+        if ( !current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post_id) )
</ins><span class="cx">                 wp_die( __('You are not allowed to move this item out of the Trash.') );
</span><span class="cx"> 
</span><span class="cx">         if ( ! wp_untrash_post($post_id) )
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx"> case 'delete':
</span><span class="cx">         check_admin_referer('delete-' . $post_type . '_' . $post_id);
</span><span class="cx"> 
</span><del>-        if ( !current_user_can($post_type_object-&gt;delete_cap, $post_id) )
</del><ins>+        if ( !current_user_can($post_type_object-&gt;cap-&gt;delete_post, $post_id) )
</ins><span class="cx">                 wp_die( __('You are not allowed to delete this item.') );
</span><span class="cx"> 
</span><span class="cx">         $force = !EMPTY_TRASH_DAYS;
</span></span></pre></div>
<a id="trunkwpincludescapabilitiesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/capabilities.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/capabilities.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-includes/capabilities.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -823,7 +823,7 @@
</span><span class="cx">                 $post = get_post( $args[0] );
</span><span class="cx">                 $post_type = get_post_type_object( $post-&gt;post_type );
</span><span class="cx">                 if ( $post_type &amp;&amp; 'post' != $post_type-&gt;capability_type ) {
</span><del>-                        $args = array_merge( array( $post_type-&gt;delete_cap, $user_id ), $args );
</del><ins>+                        $args = array_merge( array( $post_type-&gt;cap-&gt;delete_post, $user_id ), $args );
</ins><span class="cx">                         return call_user_func_array( 'map_meta_cap', $args );
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -900,7 +900,7 @@
</span><span class="cx">                 $post = get_post( $args[0] );
</span><span class="cx">                 $post_type = get_post_type_object( $post-&gt;post_type );
</span><span class="cx">                 if ( $post_type &amp;&amp; 'post' != $post_type-&gt;capability_type ) {
</span><del>-                        $args = array_merge( array( $post_type-&gt;edit_cap, $user_id ), $args );
</del><ins>+                        $args = array_merge( array( $post_type-&gt;cap-&gt;edit_post, $user_id ), $args );
</ins><span class="cx">                         return call_user_func_array( 'map_meta_cap', $args );
</span><span class="cx">                 }
</span><span class="cx">                 $post_author_data = get_userdata( $post-&gt;post_author );
</span><span class="lines">@@ -959,7 +959,7 @@
</span><span class="cx">                 $post = get_post( $args[0] );
</span><span class="cx">                 $post_type = get_post_type_object( $post-&gt;post_type );
</span><span class="cx">                 if ( $post_type &amp;&amp; 'post' != $post_type-&gt;capability_type ) {
</span><del>-                        $args = array_merge( array( $post_type-&gt;read_cap, $user_id ), $args );
</del><ins>+                        $args = array_merge( array( $post_type-&gt;cap-&gt;read_post, $user_id ), $args );
</ins><span class="cx">                         return call_user_func_array( 'map_meta_cap', $args );
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-includes/link-template.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -793,7 +793,7 @@
</span><span class="cx">         if ( !$post_type_object )
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-        if ( !current_user_can( $post_type_object-&gt;edit_cap, $post-&gt;ID ) )
</del><ins>+        if ( !current_user_can( $post_type_object-&gt;cap-&gt;edit_post, $post-&gt;ID ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         return apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object-&gt;_edit_link . $action, $post-&gt;ID) ), $post-&gt;ID, $context );
</span><span class="lines">@@ -846,7 +846,7 @@
</span><span class="cx">         if ( !$post_type_object )
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-        if ( !current_user_can( $post_type_object-&gt;delete_cap, $post-&gt;ID ) )
</del><ins>+        if ( !current_user_can( $post_type_object-&gt;cap-&gt;delete_post, $post-&gt;ID ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         $action = ( $force_delete || !EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-includes/post.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -774,12 +774,7 @@
</span><span class="cx">  * - menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
</span><span class="cx">  * - inherit_type - The post type from which to inherit the edit link and capability type. Defaults to none.
</span><span class="cx">  * - capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to &quot;post&quot;.
</span><del>- * - edit_cap - The capability that controls editing a particular object of this post type. Defaults to &quot;edit_$capability_type&quot; (edit_post).
- * - edit_type_cap - The capability that controls editing objects of this post type as a class. Defaults to &quot;edit_ . $capability_type . s&quot; (edit_posts).
- * - edit_others_cap - The capability that controls editing objects of this post type that are owned by other users. Defaults to &quot;edit_others_ . $capability_type . s&quot; (edit_others_posts).
- * - publish_others_cap - The capability that controls publishing objects of this post type. Defaults to &quot;publish_ . $capability_type . s&quot; (publish_posts).
- * - read_cap - The capability that controls reading a particular object of this post type. Defaults to &quot;read_$capability_type&quot; (read_post).
- * - delete_cap - The capability that controls deleting a particular object of this post type. Defaults to &quot;delete_$capability_type&quot; (delete_post).
</del><ins>+ * - capabilities - Array of capabilities for this post type. You can see accepted values in {@link get_post_type_capabilities()}. By default the capability_type is used to construct capabilities.
</ins><span class="cx">  * - hierarchical - Whether the post type is hierarchical. Defaults to false.
</span><span class="cx">  * - supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none.
</span><span class="cx">  * - register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form.  Do remove_meta_box() and add_meta_box() calls in the callback.
</span><span class="lines">@@ -802,7 +797,7 @@
</span><span class="cx">         // Args prefixed with an underscore are reserved for internal use.
</span><span class="cx">         $defaults = array(
</span><span class="cx">                 'labels' =&gt; array(), 'description' =&gt; '', 'publicly_queryable' =&gt; null, 'exclude_from_search' =&gt; null,
</span><del>-                '_builtin' =&gt; false, '_edit_link' =&gt; 'post.php?post=%d', 'capability_type' =&gt; 'post', 'hierarchical' =&gt; false,
</del><ins>+                '_builtin' =&gt; false, '_edit_link' =&gt; 'post.php?post=%d', 'capability_type' =&gt; 'post', 'capabilities' =&gt; array(), 'hierarchical' =&gt; false,
</ins><span class="cx">                 'public' =&gt; false, 'rewrite' =&gt; true, 'query_var' =&gt; true, 'supports' =&gt; array(), 'register_meta_box_cb' =&gt; null,
</span><span class="cx">                 'taxonomies' =&gt; array(), 'show_ui' =&gt; null, 'menu_position' =&gt; null, 'menu_icon' =&gt; null,
</span><span class="cx">                 'permalink_epmask' =&gt; EP_PERMALINK, 'can_export' =&gt; true,
</span><span class="lines">@@ -827,21 +822,9 @@
</span><span class="cx"> 
</span><span class="cx">         if ( empty($args-&gt;capability_type) )
</span><span class="cx">                 $args-&gt;capability_type = 'post';
</span><del>-        if ( empty($args-&gt;edit_cap) )
-                $args-&gt;edit_cap = 'edit_' . $args-&gt;capability_type;
-        if ( empty($args-&gt;edit_type_cap) )
-                $args-&gt;edit_type_cap = 'edit_' . $args-&gt;capability_type . 's';
-        if ( empty($args-&gt;edit_others_cap) )
-                $args-&gt;edit_others_cap = 'edit_others_' . $args-&gt;capability_type . 's';
-        if ( empty($args-&gt;publish_cap) )
-                $args-&gt;publish_cap = 'publish_' . $args-&gt;capability_type . 's';
-        if ( empty($args-&gt;read_cap) )
-                $args-&gt;read_cap = 'read_' . $args-&gt;capability_type;
-        if ( empty($args-&gt;read_private_cap) )
-                $args-&gt;read_private_cap = 'read_private_' . $args-&gt;capability_type . 's';
-        if ( empty($args-&gt;delete_cap) )
-                $args-&gt;delete_cap = 'delete_' . $args-&gt;capability_type;
</del><span class="cx"> 
</span><ins>+        $args-&gt;cap = get_post_type_capabilities( $args );
+
</ins><span class="cx">         if ( ! empty($args-&gt;supports) ) {
</span><span class="cx">                 add_post_type_support($post_type, $args-&gt;supports);
</span><span class="cx">                 unset($args-&gt;supports);
</span><span class="lines">@@ -893,6 +876,36 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Builds an object with all post type capabilities out of a post type object
+ * 
+ * Accepted keys of the capabilities array in the post type object:
+ * - edit_post - The meta capability that controls editing a particular object of this post type. Defaults to &quot;edit_$capability_type&quot; (edit_post).
+ * - edit_posts - The capability that controls editing objects of this post type as a class. Defaults to &quot;edit_ . $capability_type . s&quot; (edit_posts).
+ * - edit_others_posts - The capability that controls editing objects of this post type that are owned by other users. Defaults to &quot;edit_others_ . $capability_type . s&quot; (edit_others_posts).
+ * - publish_posts - The capability that controls publishing objects of this post type. Defaults to &quot;publish_ . $capability_type . s&quot; (publish_posts).
+ * - read_post - The meta capability that controls reading a particular object of this post type. Defaults to &quot;read_$capability_type&quot; (read_post).
+ * - read_private_posts - The capability that controls reading private posts. Defaults to &quot;read_ . $capability_type . s&quot; (read_private_posts).
+ * - delete_post - The meta capability that controls deleting a particular object of this post type. Defaults to &quot;delete_$capability_type&quot; (delete_post).
+ * 
+ * @since 3.0.0
+ * @param object $args
+ * @return object object with all the capabilities as member variables
+ */
+function get_post_type_capabilities( $args ) {
+        $defaults = array(
+                'edit_post'          =&gt; 'edit_'         . $args-&gt;capabilities['capability_type'],
+                'edit_posts'         =&gt; 'edit_'         . $args-&gt;capabilities['capability_type'] . 's',
+                'edit_others_posts'  =&gt; 'edit_others_'  . $args-&gt;capabilities['capability_type'] . 's',
+                'publish_posts'      =&gt; 'publish_'      . $args-&gt;capabilities['capability_type'] . 's',
+                'read_post'          =&gt; 'edit_'         . $args-&gt;capabilities['capability_type'],
+                'read_private_posts' =&gt; 'read_private_' . $args-&gt;capabilities['capability_type'] . 's',
+                'delete_post'        =&gt; 'delete_'       . $args-&gt;capabilities['capability_type'],
+        );
+        $labels = array_merge( $defaults, $args-&gt;capabilities );
+        return (object) $labels;
+}
+
+/**
</ins><span class="cx">  * Builds an object with all post type labels out of a post type object
</span><span class="cx">  * 
</span><span class="cx">  * Accepted keys of the label array in the post type object:
</span><span class="lines">@@ -1525,7 +1538,7 @@
</span><span class="cx">         $query = &quot;SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb-&gt;posts} WHERE post_type = %s&quot;;
</span><span class="cx">         if ( 'readable' == $perm &amp;&amp; is_user_logged_in() ) {
</span><span class="cx">                 $post_type_object = get_post_type_object($type);
</span><del>-                if ( !current_user_can( $post_type_object-&gt;read_private_cap ) ) {
</del><ins>+                if ( !current_user_can( $post_type_object-&gt;cap-&gt;read_private_posts ) ) {
</ins><span class="cx">                         $cache_key .= '_' . $perm . '_' . $user-&gt;ID;
</span><span class="cx">                         $query .= &quot; AND (post_status != 'private' OR ( post_author = '$user-&gt;ID' AND post_status = 'private' ))&quot;;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkwpincludesqueryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/query.php (14584 => 14585)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/query.php        2010-05-12 19:39:30 UTC (rev 14584)
+++ trunk/wp-includes/query.php        2010-05-12 20:45:18 UTC (rev 14585)
</span><span class="lines">@@ -2192,10 +2192,10 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty($post_type_object) ) {
</span><span class="cx">                         $post_type_cap = $post_type_object-&gt;capability_type;
</span><del>-                        $edit_cap = $post_type_object-&gt;edit_cap;
-                        $read_cap = $post_type_object-&gt;read_cap;
-                        $edit_others_cap = $post_type_object-&gt;edit_others_cap;
-                        $read_private_cap = $post_type_object-&gt;read_private_cap;
</del><ins>+                        $edit_cap = $post_type_object-&gt;cap-&gt;edit_post;
+                        $read_cap = $post_type_object-&gt;cap-&gt;read_post;
+                        $edit_others_cap = $post_type_object-&gt;cap-&gt;edit_other_posts;
+                        $read_private_cap = $post_type_object-&gt;cap-&gt;read_private_posts;
</ins><span class="cx">                 } else {
</span><span class="cx">                         $edit_cap = 'edit_' . $post_type_cap;
</span><span class="cx">                         $read_cap = 'read_' . $post_type_cap;
</span></span></pre>
</div>
</div>

</body>
</html>