Changeset 14580
- Timestamp:
- 05/12/2010 07:12:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r14571 r14580 312 312 313 313 $tax_names = get_object_taxonomies( get_post($post_ID) ); 314 315 314 if ( isset($new_cats) && in_array( 'category', $tax_names ) ) { 316 315 $cats = (array) wp_get_post_categories($post_ID); … … 319 318 320 319 foreach ( $tax_names as $tax_name ) { 321 if( isset( $tax_input[$tax_name]) ) { 322 if ( is_taxonomy_hierarchical( $tax_name ) ) 323 $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') ); 324 else 325 $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'names') ); 326 $post_data['tax_input'][$tax_name] = array_merge( $terms, $tax_input[$tax_name] ); 327 } 320 $taxonomy_obj = get_taxonomy($tax_name); 321 if( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->assign_cap ) ) 322 $new_terms = $tax_input[$tax_name]; 323 else 324 $new_terms = array(); 325 326 if ( $taxonomy_obj->hierarchical ) 327 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') ); 328 else 329 $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'names') ); 330 331 $post_data['tax_input'][$tax_name] = array_merge( $current_terms, $new_terms ); 328 332 } 329 333
Note: See TracChangeset
for help on using the changeset viewer.