WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/13/2010 04:10:17 AM (12 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/edit-tags.php

    r14139 r14593  
    4242    check_admin_referer('add-tag');
    4343
    44     if ( !current_user_can($tax->edit_cap) )
     44    if ( !current_user_can($tax->cap->edit_terms) )
    4545        wp_die(__('Cheatin’ uh?'));
    4646
     
    8080    check_admin_referer('delete-tag_' .  $tag_ID);
    8181
    82     if ( !current_user_can($tax->delete_cap) )
     82    if ( !current_user_can($tax->cap->delete_terms) )
    8383        wp_die(__('Cheatin’ uh?'));
    8484
     
    9494    check_admin_referer('bulk-tags');
    9595
    96     if ( !current_user_can($tax->delete_cap) )
     96    if ( !current_user_can($tax->cap->delete_terms) )
    9797        wp_die(__('Cheatin’ uh?'));
    9898
     
    131131    check_admin_referer('update-tag_' . $tag_ID);
    132132
    133     if ( !current_user_can($tax->edit_cap) )
     133    if ( !current_user_can($tax->cap->edit_terms) )
    134134        wp_die(__('Cheatin’ uh?'));
    135135
     
    162162
    163163wp_enqueue_script('admin-tags');
    164 if ( current_user_can($tax->edit_cap) )
     164if ( current_user_can($tax->cap->edit_terms) )
    165165    wp_enqueue_script('inline-edit-tax');
    166166
     
    319319
    320320<?php
    321 if ( current_user_can( $tax->edit_cap ) )
     321if ( current_user_can( $tax->cap->edit_terms ) )
    322322    $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
    323323else
     
    333333endif;
    334334
    335 if ( current_user_can($tax->edit_cap) ) {
     335if ( current_user_can($tax->cap->edit_terms) ) {
    336336    if ( 'category' == $taxonomy )
    337337        do_action('add_category_form_pre', (object)array('parent' => 0) );  // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form
Note: See TracChangeset for help on using the changeset viewer.