<!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">                 <h4><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></h4>
</span><span class="cx">
</span><span class="cx">
</span><del>-<?php if ( $bulk ) : ?>
</del><ins>+<?php
+
+if ( post_type_supports( $screen->post_type, 'title' ) ) :
+        if ( $bulk ) : ?>
</ins><span class="cx">                 <div id="bulk-title-div">
</span><span class="cx">                         <div id="bulk-titles"></div>
</span><span class="cx">                 </div>
</span><span class="lines">@@ -907,16 +910,15 @@
</span><span class="cx">                         <span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
</span><span class="cx">                 </label>
</span><span class="cx">
</span><del>-<?php endif; // $bulk ?>
-
-
-<?php if ( !$bulk ) : ?>
-
</del><span class="cx">                 <label>
</span><span class="cx">                         <span class="title"><?php _e( 'Slug' ); ?></span>
</span><span class="cx">                         <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
</span><span class="cx">                 </label>
</span><span class="cx">
</span><ins>+<?php endif; // $bulk
+endif; // post_type_supports title ?>
+
+<?php if ( !$bulk ) : ?>
</ins><span class="cx">                 <label><span class="title"><?php _e( 'Date' ); ?></span></label>
</span><span class="cx">                 <div class="inline-edit-date">
</span><span class="cx">                         <?php touch_time(1, 1, 4, 1); ?>
</span><span class="lines">@@ -925,6 +927,7 @@
</span><span class="cx">
</span><span class="cx"> <?php endif; // $bulk
</span><span class="cx">
</span><ins>+        if ( post_type_supports( $screen->post_type, 'author' ) ) :
</ins><span class="cx">                 $authors = get_editable_user_ids( $current_user->id, true, $screen->post_type ); // TODO: ROLE SYSTEM
</span><span class="cx">                 $authors_dropdown = '';
</span><span class="cx">                 if ( $authors && count( $authors ) > 1 ) :
</span><span class="lines">@@ -939,8 +942,12 @@
</span><span class="cx">                 endif; // authors
</span><span class="cx"> ?>
</span><span class="cx">
</span><del>-<?php if ( !$bulk ) : echo $authors_dropdown; ?>
</del><ins>+<?php if ( !$bulk ) echo $authors_dropdown;
+endif; // post_type_supports author
</ins><span class="cx">
</span><ins>+if ( !$bulk ) :
+?>
+
</ins><span class="cx">                 <div class="inline-edit-group">
</span><span class="cx">                         <label class="alignleft">
</span><span class="cx">                                 <span class="title"><?php _e( 'Password' ); ?></span>
</span><span class="lines">@@ -986,7 +993,7 @@
</span><span class="cx">         <fieldset class="inline-edit-col-right"><div class="inline-edit-col">
</span><span class="cx">
</span><span class="cx"> <?php
</span><del>-        if ( $bulk )
</del><ins>+        if ( post_type_supports( $screen->post_type, 'author' ) && $bulk )
</ins><span class="cx">                 echo $authors_dropdown;
</span><span class="cx"> ?>
</span><span class="cx">
</span><span class="lines">@@ -1003,7 +1010,8 @@
</span><span class="cx"> ?>
</span><span class="cx">                 </label>
</span><span class="cx">
</span><del>-<?php        if ( !$bulk ) : ?>
</del><ins>+<?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
+                if ( !$bulk ) : ?>
</ins><span class="cx">
</span><span class="cx">                 <label>
</span><span class="cx">                         <span class="title"><?php _e( 'Order' ); ?></span>
</span><span class="lines">@@ -1023,7 +1031,9 @@
</span><span class="cx">                         </select>
</span><span class="cx">                 </label>
</span><span class="cx">
</span><del>-<?php endif; // $post_type_object->hierarchical ?>
</del><ins>+<?php
+        endif; // post_type_supports page-attributes
+endif; // $post_type_object->hierarchical ?>
</ins><span class="cx">
</span><span class="cx"> <?php if ( count($flat_taxonomies) && !$bulk ) : ?>
</span><span class="cx">
</span><span class="lines">@@ -1038,9 +1048,11 @@
</span><span class="cx">
</span><span class="cx"> <?php endif; // count($flat_taxonomies) && !$bulk ?>
</span><span class="cx">
</span><del>-<?php if ( $bulk ) : ?>
</del><ins>+<?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
+        if ( $bulk ) : ?>
</ins><span class="cx">
</span><span class="cx">                 <div class="inline-edit-group">
</span><ins>+        <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
</ins><span class="cx">                 <label class="alignleft">
</span><span class="cx">                         <span class="title"><?php _e( 'Comments' ); ?></span>
</span><span class="cx">                         <select name="comment_status">
</span><span class="lines">@@ -1049,7 +1061,7 @@
</span><span class="cx">                                 <option value="closed"><?php _e('Do not allow'); ?></option>
</span><span class="cx">                         </select>
</span><span class="cx">                 </label>
</span><del>-
</del><ins>+        <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
</ins><span class="cx">                 <label class="alignright">
</span><span class="cx">                         <span class="title"><?php _e( 'Pings' ); ?></span>
</span><span class="cx">                         <select name="ping_status">
</span><span class="lines">@@ -1058,25 +1070,28 @@
</span><span class="cx">                                 <option value="closed"><?php _e('Do not allow'); ?></option>
</span><span class="cx">                         </select>
</span><span class="cx">                 </label>
</span><ins>+        <?php endif; ?>
</ins><span class="cx">                 </div>
</span><span class="cx">
</span><span class="cx"> <?php else : // $bulk ?>
</span><span class="cx">
</span><span class="cx">                 <div class="inline-edit-group">
</span><ins>+                <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
</ins><span class="cx">                         <label class="alignleft">
</span><span class="cx">                                 <input type="checkbox" name="comment_status" value="open" />
</span><span class="cx">                                 <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
</span><span class="cx">                         </label>
</span><del>-
</del><ins>+                <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
</ins><span class="cx">                         <label class="alignleft">
</span><span class="cx">                                 <input type="checkbox" name="ping_status" value="open" />
</span><span class="cx">                                 <span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
</span><span class="cx">                         </label>
</span><ins>+                <?php endif; ?>
</ins><span class="cx">                 </div>
</span><span class="cx">
</span><del>-<?php endif; // $bulk ?>
</del><ins>+<?php endif; // $bulk
+endif; // post_type_supports comments or pings ?>
</ins><span class="cx">
</span><del>-
</del><span class="cx">                 <div class="inline-edit-group">
</span><span class="cx">                         <label class="inline-edit-status alignleft">
</span><span class="cx">                                 <span class="title"><?php _e( 'Status' ); ?></span>
</span></span></pre>
</div>
</div>
</body>
</html>