Make WordPress Core


Ignore:
Timestamp:
01/28/2013 03:23:01 AM (12 years ago)
Author:
SergeyBiryukov
Message:

Consistently use a helper function instead of directly printing the disabled attribute.

Remove an erroneous esc_attr() call.

fixes #23194.

File:
1 edited

Legend:

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

    r23351 r23352  
    177177
    178178    $tax = get_taxonomy($taxonomy);
    179     if ( ! current_user_can($tax->cap->assign_terms) )
    180         $disabled = 'disabled="disabled"';
    181     else
    182         $disabled = '';
    183179
    184180    $popular_ids = array();
     
    193189        <li id="<?php echo $id; ?>" class="popular-category">
    194190            <label class="selectit">
    195             <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php echo $disabled ?>/>
     191            <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />
    196192                <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?>
    197193            </label>
Note: See TracChangeset for help on using the changeset viewer.