WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/07/2010 05:08:37 AM (11 years ago)
Author:
nacin
Message:

Check for post type support in quick/bulk edit. props caesarsgrunt for some of the commit. see #12869

File:
1 edited

Legend:

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

    r14024 r14025  
    896896
    897897
    898 <?php if ( $bulk ) : ?>
     898<?php
     899
     900if ( post_type_supports( $screen->post_type, 'title' ) ) :
     901    if ( $bulk ) : ?>
    899902        <div id="bulk-title-div">
    900903            <div id="bulk-titles"></div>
     
    908911        </label>
    909912
    910 <?php endif; // $bulk ?>
    911 
    912 
    913 <?php if ( !$bulk ) : ?>
    914 
    915913        <label>
    916914            <span class="title"><?php _e( 'Slug' ); ?></span>
     
    918916        </label>
    919917
     918<?php endif; // $bulk
     919endif; // post_type_supports title ?>
     920
     921<?php if ( !$bulk ) : ?>
    920922        <label><span class="title"><?php _e( 'Date' ); ?></span></label>
    921923        <div class="inline-edit-date">
     
    926928<?php endif; // $bulk
    927929
     930    if ( post_type_supports( $screen->post_type, 'author' ) ) :
    928931        $authors = get_editable_user_ids( $current_user->id, true, $screen->post_type ); // TODO: ROLE SYSTEM
    929932        $authors_dropdown = '';
     
    940943?>
    941944
    942 <?php if ( !$bulk ) : echo $authors_dropdown; ?>
     945<?php if ( !$bulk ) echo $authors_dropdown;
     946endif; // post_type_supports author
     947
     948if ( !$bulk ) :
     949?>
    943950
    944951        <div class="inline-edit-group">
     
    987994
    988995<?php
    989     if ( $bulk )
     996    if ( post_type_supports( $screen->post_type, 'author' ) && $bulk )
    990997        echo $authors_dropdown;
    991998?>
     
    10041011        </label>
    10051012
    1006 <?php   if ( !$bulk ) : ?>
     1013<?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
     1014        if ( !$bulk ) : ?>
    10071015
    10081016        <label>
     
    10241032        </label>
    10251033
    1026 <?php endif; // $post_type_object->hierarchical ?>
     1034<?php
     1035    endif; // post_type_supports page-attributes
     1036endif; // $post_type_object->hierarchical ?>
    10271037
    10281038<?php if ( count($flat_taxonomies) && !$bulk ) : ?>
     
    10391049<?php endif; // count($flat_taxonomies) && !$bulk  ?>
    10401050
    1041 <?php if ( $bulk ) : ?>
     1051<?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
     1052    if ( $bulk ) : ?>
    10421053
    10431054        <div class="inline-edit-group">
     1055    <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
    10441056        <label class="alignleft">
    10451057            <span class="title"><?php _e( 'Comments' ); ?></span>
     
    10501062            </select>
    10511063        </label>
    1052 
     1064    <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
    10531065        <label class="alignright">
    10541066            <span class="title"><?php _e( 'Pings' ); ?></span>
     
    10591071            </select>
    10601072        </label>
     1073    <?php endif; ?>
    10611074        </div>
    10621075
     
    10641077
    10651078        <div class="inline-edit-group">
     1079        <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
    10661080            <label class="alignleft">
    10671081                <input type="checkbox" name="comment_status" value="open" />
    10681082                <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
    10691083            </label>
    1070 
     1084        <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
    10711085            <label class="alignleft">
    10721086                <input type="checkbox" name="ping_status" value="open" />
    10731087                <span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
    10741088            </label>
     1089        <?php endif; ?>
    10751090        </div>
    10761091
    1077 <?php endif; // $bulk ?>
    1078 
     1092<?php endif; // $bulk
     1093endif; // post_type_supports comments or pings ?>
    10791094
    10801095        <div class="inline-edit-group">
Note: See TracChangeset for help on using the changeset viewer.