<!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>[14025] trunk/wp-admin/includes/template.php:
  Check for post type support in quick/bulk edit.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14025">14025</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-04-07 05:08:37 +0000 (Wed, 07 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Check for post type support in quick/bulk edit. props caesarsgrunt for some of the commit. see <a href="http://trac.wordpress.org/ticket/12869">#12869</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (14024 => 14025)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-04-07 03:54:43 UTC (rev 14024)
+++ trunk/wp-admin/includes/template.php        2010-04-07 05:08:37 UTC (rev 14025)
</span><span class="lines">@@ -895,7 +895,10 @@
</span><span class="cx">                 &lt;h4&gt;&lt;?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?&gt;&lt;/h4&gt;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-&lt;?php if ( $bulk ) : ?&gt;
</del><ins>+&lt;?php
+
+if ( post_type_supports( $screen-&gt;post_type, 'title' ) ) : 
+        if ( $bulk ) : ?&gt;
</ins><span class="cx">                 &lt;div id=&quot;bulk-title-div&quot;&gt;
</span><span class="cx">                         &lt;div id=&quot;bulk-titles&quot;&gt;&lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="lines">@@ -907,16 +910,15 @@
</span><span class="cx">                         &lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;post_title&quot; class=&quot;ptitle&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><span class="cx"> 
</span><del>-&lt;?php endif; // $bulk ?&gt;
-
-
-&lt;?php if ( !$bulk ) : ?&gt;
-
</del><span class="cx">                 &lt;label&gt;
</span><span class="cx">                         &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Slug' ); ?&gt;&lt;/span&gt;
</span><span class="cx">                         &lt;span class=&quot;input-text-wrap&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;post_name&quot; value=&quot;&quot; /&gt;&lt;/span&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><span class="cx"> 
</span><ins>+&lt;?php endif; // $bulk
+endif; // post_type_supports title ?&gt;
+
+&lt;?php if ( !$bulk ) : ?&gt;
</ins><span class="cx">                 &lt;label&gt;&lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Date' ); ?&gt;&lt;/span&gt;&lt;/label&gt;
</span><span class="cx">                 &lt;div class=&quot;inline-edit-date&quot;&gt;
</span><span class="cx">                         &lt;?php touch_time(1, 1, 4, 1); ?&gt;
</span><span class="lines">@@ -925,6 +927,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php endif; // $bulk
</span><span class="cx"> 
</span><ins>+        if ( post_type_supports( $screen-&gt;post_type, 'author' ) ) :
</ins><span class="cx">                 $authors = get_editable_user_ids( $current_user-&gt;id, true, $screen-&gt;post_type ); // TODO: ROLE SYSTEM
</span><span class="cx">                 $authors_dropdown = '';
</span><span class="cx">                 if ( $authors &amp;&amp; count( $authors ) &gt; 1 ) :
</span><span class="lines">@@ -939,8 +942,12 @@
</span><span class="cx">                 endif; // authors
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( !$bulk ) : echo $authors_dropdown; ?&gt;
</del><ins>+&lt;?php if ( !$bulk ) echo $authors_dropdown;
+endif; // post_type_supports author
</ins><span class="cx"> 
</span><ins>+if ( !$bulk ) :
+?&gt;
+
</ins><span class="cx">                 &lt;div class=&quot;inline-edit-group&quot;&gt;
</span><span class="cx">                         &lt;label class=&quot;alignleft&quot;&gt;
</span><span class="cx">                                 &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Password' ); ?&gt;&lt;/span&gt;
</span><span class="lines">@@ -986,7 +993,7 @@
</span><span class="cx">         &lt;fieldset class=&quot;inline-edit-col-right&quot;&gt;&lt;div class=&quot;inline-edit-col&quot;&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><del>-        if ( $bulk )
</del><ins>+        if ( post_type_supports( $screen-&gt;post_type, 'author' ) &amp;&amp; $bulk )
</ins><span class="cx">                 echo $authors_dropdown;
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1003,7 +1010,8 @@
</span><span class="cx"> ?&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><span class="cx"> 
</span><del>-&lt;?php        if ( !$bulk ) : ?&gt;
</del><ins>+&lt;?php if ( post_type_supports( $screen-&gt;post_type, 'page-attributes' ) ) :
+                if ( !$bulk ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;label&gt;
</span><span class="cx">                         &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Order' ); ?&gt;&lt;/span&gt;
</span><span class="lines">@@ -1023,7 +1031,9 @@
</span><span class="cx">                         &lt;/select&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><span class="cx"> 
</span><del>-&lt;?php endif; // $post_type_object-&gt;hierarchical ?&gt;
</del><ins>+&lt;?php 
+        endif; // post_type_supports page-attributes
+endif; // $post_type_object-&gt;hierarchical ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;?php if ( count($flat_taxonomies) &amp;&amp; !$bulk ) : ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1038,9 +1048,11 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php endif; // count($flat_taxonomies) &amp;&amp; !$bulk  ?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( $bulk ) : ?&gt;
</del><ins>+&lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) || post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) :
+        if ( $bulk ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;div class=&quot;inline-edit-group&quot;&gt;
</span><ins>+        &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) ) : ?&gt;
</ins><span class="cx">                 &lt;label class=&quot;alignleft&quot;&gt;
</span><span class="cx">                         &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Comments' ); ?&gt;&lt;/span&gt;
</span><span class="cx">                         &lt;select name=&quot;comment_status&quot;&gt;
</span><span class="lines">@@ -1049,7 +1061,7 @@
</span><span class="cx">                                 &lt;option value=&quot;closed&quot;&gt;&lt;?php _e('Do not allow'); ?&gt;&lt;/option&gt;
</span><span class="cx">                         &lt;/select&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><del>-
</del><ins>+        &lt;?php endif; if ( post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) : ?&gt;
</ins><span class="cx">                 &lt;label class=&quot;alignright&quot;&gt;
</span><span class="cx">                         &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Pings' ); ?&gt;&lt;/span&gt;
</span><span class="cx">                         &lt;select name=&quot;ping_status&quot;&gt;
</span><span class="lines">@@ -1058,25 +1070,28 @@
</span><span class="cx">                                 &lt;option value=&quot;closed&quot;&gt;&lt;?php _e('Do not allow'); ?&gt;&lt;/option&gt;
</span><span class="cx">                         &lt;/select&gt;
</span><span class="cx">                 &lt;/label&gt;
</span><ins>+        &lt;?php endif; ?&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php else : // $bulk ?&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;div class=&quot;inline-edit-group&quot;&gt;
</span><ins>+                &lt;?php if ( post_type_supports( $screen-&gt;post_type, 'comments' ) ) : ?&gt;
</ins><span class="cx">                         &lt;label class=&quot;alignleft&quot;&gt;
</span><span class="cx">                                 &lt;input type=&quot;checkbox&quot; name=&quot;comment_status&quot; value=&quot;open&quot; /&gt;
</span><span class="cx">                                 &lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php _e( 'Allow Comments' ); ?&gt;&lt;/span&gt;
</span><span class="cx">                         &lt;/label&gt;
</span><del>-
</del><ins>+                &lt;?php endif; if ( post_type_supports( $screen-&gt;post_type, 'trackbacks' ) ) : ?&gt;
</ins><span class="cx">                         &lt;label class=&quot;alignleft&quot;&gt;
</span><span class="cx">                                 &lt;input type=&quot;checkbox&quot; name=&quot;ping_status&quot; value=&quot;open&quot; /&gt;
</span><span class="cx">                                 &lt;span class=&quot;checkbox-title&quot;&gt;&lt;?php _e( 'Allow Pings' ); ?&gt;&lt;/span&gt;
</span><span class="cx">                         &lt;/label&gt;
</span><ins>+                &lt;?php endif; ?&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;?php endif; // $bulk ?&gt;
</del><ins>+&lt;?php endif; // $bulk
+endif; // post_type_supports comments or pings ?&gt;
</ins><span class="cx"> 
</span><del>-
</del><span class="cx">                 &lt;div class=&quot;inline-edit-group&quot;&gt;
</span><span class="cx">                         &lt;label class=&quot;inline-edit-status alignleft&quot;&gt;
</span><span class="cx">                                 &lt;span class=&quot;title&quot;&gt;&lt;?php _e( 'Status' ); ?&gt;&lt;/span&gt;
</span></span></pre>
</div>
</div>

</body>
</html>