diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index 5a450382b4..d9e021665f 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -254,7 +254,7 @@ function bulk_edit_posts( $post_data = null ) {
$post_IDs = array_map( 'intval', (array) $post_data['post'] );
- $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' );
+ $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tax_input', 'post_category', 'sticky' );
foreach ( $reset as $field ) {
if ( isset($post_data[$field]) && ( '' == $post_data[$field] || -1 == $post_data[$field] ) )
unset($post_data[$field]);
@@ -266,10 +266,20 @@ function bulk_edit_posts( $post_data = null ) {
else
unset($post_data['post_category']);
}
-
- if ( isset($post_data['tags_input']) ) {
- $new_tags = preg_replace( '/\s*,\s*/', ',', rtrim( trim($post_data['tags_input']), ' ,' ) );
- $new_tags = explode(',', $new_tags);
+
+ $tax_input = array();
+ if ( isset($post_data['tax_input'])) {
+ foreach ( $post_data['tax_input'] as $tax_name => $terms ) {
+ if ( empty($terms) )
+ continue;
+ $taxonomy = get_taxonomy( $tax_name );
+ if ( $taxonomy->hierarchical )
+ $tax_input[$tax_name] = array_map( 'absint', $terms );
+ else {
+ $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) );
+ $tax_input[$tax_name] = explode(',', $tax_input[$tax_name]);
+ }
+ }
}
if ( isset($post_data['post_parent']) && ($parent = (int) $post_data['post_parent']) ) {
@@ -300,15 +310,23 @@ function bulk_edit_posts( $post_data = null ) {
$locked[] = $post_ID;
continue;
}
-
- if ( isset($new_cats) ) {
+
+ $tax_names = get_object_taxonomies( get_post($post_ID) );
+
+ if ( isset($new_cats) && in_array( 'category', $tax_names ) ) {
$cats = (array) wp_get_post_categories($post_ID);
$post_data['post_category'] = array_unique( array_merge($cats, $new_cats) );
}
-
- if ( isset($new_tags) ) {
- $tags = wp_get_post_tags($post_ID, array('fields' => 'names'));
- $post_data['tags_input'] = array_unique( array_merge($tags, $new_tags) );
+
+ foreach ( $tax_names as $tax_name ) {
+ if( isset( $tax_input[$tax_name]) ) {
+ $taxonomy = get_taxonomy( $tax_name );
+ if( $taxonomy->hierarchical )
+ $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') );
+ else
+ $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'names') );
+ $post_data['tax_input'][$tax_name] = array_merge( $terms, $tax_input[$tax_name] );
+ }
}
$post_data['ID'] = $post_ID;
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 6486996c3a..06f9cb7eff 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -911,6 +911,20 @@ function inline_edit_row( $screen ) {
$post = get_default_post_to_edit( $screen->post_type );
$post_type_object = get_post_type_object( $screen->post_type );
+ $taxonomy_names = get_object_taxonomies( $screen->post_type );
+ $hierarchical_taxonomies = array();
+ $flat_taxonomies = array();
+ foreach ( $taxonomy_names as $taxonomy_name ) {
+ $taxonomy = get_taxonomy( $taxonomy_name);
+
+ if( !$taxonomy->show_ui ) continue;
+
+ if( $taxonomy->hierarchical )
+ $hierarchical_taxonomies[] = $taxonomy;
+ else
+ $flat_taxonomies[] = $taxonomy;
+ }
+
$columns = wp_manage_posts_columns($screen);
$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
$col_count = count($columns) - count($hidden);
@@ -1002,19 +1016,25 @@ function inline_edit_row( $screen ) {
-post_type, 'category') && !$bulk ) : ?>
+
-post_type, 'category') && !$bulk ?>
+