WordPress.org

Make WordPress Core

Changeset 13217


Ignore:
Timestamp:
02/19/10 10:26:44 (5 years ago)
Author:
dd32
Message:

More Taxonomy cap checks. See #12035

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r12987 r13217  
    9898    $label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name; 
    9999 
    100     if ( !current_user_can($taxonomy->manage_cap) ) 
    101         continue; 
    102  
    103100    if ( !is_taxonomy_hierarchical($tax_name) ) 
    104101        add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core'); 
  • trunk/wp-admin/menu.php

    r13216 r13217  
    6161            continue; 
    6262 
    63         $submenu['edit.php'][$i++] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name ); 
     63        $submenu['edit.php'][$i++] = array( esc_attr($tax->label), $tax->manage_cap, 'edit-tags.php?taxonomy=' . $tax->name ); 
    6464    } 
    6565    unset($tax); 
     
    9898            continue; 
    9999 
    100         $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label), 'manage_categories', "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" ); 
     100        $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label), $tax->manage_cap, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" ); 
    101101    } 
    102102} 
  • trunk/wp-includes/post.php

    r13209 r13217  
    21752175    // new-style support for all tag-like taxonomies 
    21762176    if ( !empty($tax_input) ) { 
    2177         foreach ( $tax_input as $taxonomy => $tags ) 
    2178             wp_set_post_terms( $post_ID, $tags, $taxonomy ); 
     2177        foreach ( $tax_input as $taxonomy => $tags ) { 
     2178            $taxonomy_obj = get_taxonomy($taxonomy); 
     2179            if ( current_user_can($taxonomy_obj->manage_cap) ) 
     2180                wp_set_post_terms( $post_ID, $tags, $taxonomy ); 
     2181        } 
    21792182    } 
    21802183 
Note: See TracChangeset for help on using the changeset viewer.