2234 | | foreach ( $tax_input as $taxonomy => $tags ) { |
2235 | | $taxonomy_obj = get_taxonomy($taxonomy); |
2236 | | if ( current_user_can($taxonomy_obj->assign_cap) ) |
2237 | | wp_set_post_terms( $post_ID, $tags, $taxonomy ); |
| 2234 | $tax_names = get_object_taxonomies( get_post($post_ID) ); |
| 2235 | |
| 2236 | foreach ( $tax_names as $tax_name ) { |
| 2237 | $tax_obj = get_taxonomy($tax_name); |
| 2238 | if ( !current_user_can($tax_obj->assign_cap) ) |
| 2239 | continue; |
| 2240 | |
| 2241 | if ( isset($tax_input[$tax_name]) ) |
| 2242 | $term = $tax_input[$tax_name]; |
| 2243 | else |
| 2244 | $term = array(); |
| 2245 | |
| 2246 | wp_set_post_terms( $post_ID, $term, $tax_name ); |