More Taxonomy cap checks. See #12035

git-svn-id: http://svn.automattic.com/wordpress/trunk@13217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-02-19 10:26:44 +00:00
parent 39620db24d
commit 35cdac687c
3 changed files with 7 additions and 7 deletions

View File

@ -97,9 +97,6 @@ foreach ( get_object_taxonomies($post_type) as $tax_name ) {
$taxonomy = get_taxonomy($tax_name);
$label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name;
if ( !current_user_can($taxonomy->manage_cap) )
continue;
if ( !is_taxonomy_hierarchical($tax_name) )
add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core');
else

View File

@ -60,7 +60,7 @@ $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu
if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) )
continue;
$submenu['edit.php'][$i++] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
$submenu['edit.php'][$i++] = array( esc_attr($tax->label), $tax->manage_cap, 'edit-tags.php?taxonomy=' . $tax->name );
}
unset($tax);
@ -97,7 +97,7 @@ foreach ( (array) get_post_types( array('show_ui' => true) ) as $ptype ) {
if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) )
continue;
$submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label), 'manage_categories', "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
$submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr($tax->label), $tax->manage_cap, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
}
}
unset($ptype, $ptype_obj);

View File

@ -2174,8 +2174,11 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
wp_set_post_tags( $post_ID, $tags_input );
// new-style support for all tag-like taxonomies
if ( !empty($tax_input) ) {
foreach ( $tax_input as $taxonomy => $tags )
wp_set_post_terms( $post_ID, $tags, $taxonomy );
foreach ( $tax_input as $taxonomy => $tags ) {
$taxonomy_obj = get_taxonomy($taxonomy);
if ( current_user_can($taxonomy_obj->manage_cap) )
wp_set_post_terms( $post_ID, $tags, $taxonomy );
}
}
$current_guid = get_post_field( 'guid', $post_ID );