WordPress.org

Make WordPress Core

Changeset 14247


Ignore:
Timestamp:
04/27/2010 12:44:38 AM (11 years ago)
Author:
ryan
Message:

Revert [14230]. Broke menu save. see #10122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r14230 r14247  
    21912191    $where = array( 'ID' => $post_ID );
    21922192
    2193     if ( $update ) {
     2193    if ($update) {
    21942194        do_action( 'pre_post_update', $post_ID );
    21952195        if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
     
    22302230    if ( isset( $tags_input ) )
    22312231        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        }
    22452239    }
    22462240
     
    22722266    wp_transition_post_status($data['post_status'], $previous_status, $post);
    22732267
    2274     if ( $update )
     2268    if ( $update)
    22752269        do_action('edit_post', $post_ID, $post);
    22762270
     
    23272321    }
    23282322
    2329     if ( $postarr['post_type'] == 'attachment' )
     2323    if ($postarr['post_type'] == 'attachment')
    23302324        return wp_insert_attachment($postarr);
    23312325
Note: See TracChangeset for help on using the changeset viewer.