| 319 | | if( isset( $tax_input[$tax_name]) ) { |
| 320 | | if ( is_taxonomy_hierarchical( $tax_name ) ) |
| 321 | | $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') ); |
| 322 | | else |
| 323 | | $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'names') ); |
| 324 | | $post_data['tax_input'][$tax_name] = array_merge( $terms, $tax_input[$tax_name] ); |
| 325 | | } |
| | 318 | $taxonomy_obj = get_taxonomy($tax_name); |
| | 319 | if( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->assign_cap ) ) |
| | 320 | $new_terms = $tax_input[$tax_name]; |
| | 321 | else |
| | 322 | $new_terms = array(); |
| | 323 | |
| | 324 | if ( $taxonomy_obj->hierarchical ) |
| | 325 | $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') ); |
| | 326 | else |
| | 327 | $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'names') ); |
| | 328 | |
| | 329 | $post_data['tax_input'][$tax_name] = array_merge( $current_terms, $new_terms ); |