Changeset 14247
- Timestamp:
- 04/27/2010 12:44:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14230 r14247 2191 2191 $where = array( 'ID' => $post_ID ); 2192 2192 2193 if ( $update) {2193 if ($update) { 2194 2194 do_action( 'pre_post_update', $post_ID ); 2195 2195 if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { … … 2230 2230 if ( isset( $tags_input ) ) 2231 2231 wp_set_post_tags( $post_ID, $tags_input ); 2232 // new-style support for all taxonomies 2233 $tax_names = get_object_taxonomies( get_post($post_ID) ); 2234 foreach ( (array)$tax_names as $taxonomy ) { 2235 if ( 'category' == $taxonomy ) // Handled seperately. 2236 continue; 2237 $taxonomy_obj = get_taxonomy($taxonomy); 2238 if ( !current_user_can($taxonomy_obj->assign_cap) ) 2239 continue; 2240 if ( !$taxonomy_obj->show_ui ) 2241 continue; 2242 2243 $tags = isset($tax_input[$taxonomy]) ? $tax_input[$taxonomy] : array(); 2244 wp_set_post_terms( $post_ID, $tags, $taxonomy ); 2232 // new-style support for all tag-like taxonomies 2233 if ( !empty($tax_input) ) { 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 ); 2238 } 2245 2239 } 2246 2240 … … 2272 2266 wp_transition_post_status($data['post_status'], $previous_status, $post); 2273 2267 2274 if ( $update 2268 if ( $update) 2275 2269 do_action('edit_post', $post_ID, $post); 2276 2270 … … 2327 2321 } 2328 2322 2329 if ( $postarr['post_type'] == 'attachment')2323 if ($postarr['post_type'] == 'attachment') 2330 2324 return wp_insert_attachment($postarr); 2331 2325
Note: See TracChangeset
for help on using the changeset viewer.