diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 78cbde795..cdec03a0c 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -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 diff --git a/wp-admin/menu.php b/wp-admin/menu.php index e9b5fa5b8..8018c0bf7 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -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); diff --git a/wp-includes/post.php b/wp-includes/post.php index 6429f9f5e..775d17cbc 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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 );