Make WordPress Core


Ignore:
Timestamp:
01/26/2010 11:32:04 AM (16 years ago)
Author:
dd32
Message:

First scratch at Taxonomy Capabilities. See #12035

File:
1 edited

Legend:

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

    r12798 r12833  
    240240    $tax_name = esc_attr(substr($box['id'], 8));
    241241    $taxonomy = get_taxonomy($tax_name);
     242    if ( !current_user_can($taxonomy->manage_cap) )
     243        return;
    242244    $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.');
    243245?>
     
    276278        $args = $box['args'];
    277279    extract( wp_parse_args($args, $defaults), EXTR_SKIP );
     280    $tax = get_taxonomy($taxonomy);
     281
     282    if ( !current_user_can($tax->manage_cap) )
     283        return;
    278284    ?>
    279285    <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
     
    295301        </div>
    296302
    297     <?php if ( current_user_can('manage_categories') ) : ?>
     303    <?php if ( current_user_can($tax->edit_cap) ) : ?>
    298304            <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
    299305                <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
Note: See TracChangeset for help on using the changeset viewer.