Make WordPress Core


Ignore:
Timestamp:
05/13/2010 04:10:17 AM (16 years ago)
Author:
nacin
Message:

Move taxonomy object properties for capabilities into a cap object. Capabilities can be specified via capabilities (an array keyed by the generic cap name) for register_taxonomy. fixes #13358.

File:
1 edited

Legend:

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

    r14585 r14593  
    250250        $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud        : __('Choose from the most used tags in %s');
    251251
    252         $disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : '';
     252        $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
    253253?>
    254254<div class="tagsdiv" id="<?php echo $tax_name; ?>">
     
    257257        <p><?php echo $help_nojs; ?></p>
    258258        <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
    259         <?php if ( current_user_can($taxonomy->assign_cap) ) : ?>
     259        <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    260260        <div class="ajaxtag hide-if-no-js">
    261261                <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
     
    269269        <div class="tagchecklist"></div>
    270270</div>
    271 <?php if ( current_user_can($taxonomy->assign_cap) ) : ?>
     271<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
    272272<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( $help_cloud, $box['title'] ); ?></a></p>
    273273<?php else : ?>
     
    316316                        </ul>
    317317                </div>
    318         <?php if ( !current_user_can($tax->assign_cap) ) : ?>
     318        <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
    319319        <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
    320320        <?php endif; ?>
    321         <?php if ( current_user_can($tax->edit_cap) ) : ?>
     321        <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
    322322                        <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
    323323                                <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>
Note: See TracChangeset for help on using the changeset viewer.