Make WordPress Core


Ignore:
Timestamp:
02/13/2010 06:04:54 AM (14 years ago)
Author:
dd32
Message:

Flow on tax-modification errors on Tax inline edit to the UI. See #11838

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r13086 r13088  
    11321132
    11331133    switch ($_POST['tax_type']) {
    1134         case 'cat' :
    1135             $data = array();
    1136             $data['cat_ID'] = $id;
    1137             $data['cat_name'] = $_POST['name'];
    1138             $data['category_nicename'] = $_POST['slug'];
    1139             if ( isset($_POST['parent']) && (int) $_POST['parent'] > 0 )
    1140                 $data['category_parent'] = $_POST['parent'];
    1141 
    1142             $cat = get_category($id, ARRAY_A);
    1143             $data['category_description'] = $cat['category_description'];
    1144 
    1145             $updated = wp_update_category($data);
    1146 
    1147             if ( $updated && !is_wp_error($updated) )
    1148                 echo _cat_row( $updated, 0 );
    1149             else
    1150                 die( __('Category not updated.') );
    1151 
    1152             break;
    11531134        case 'link-cat' :
    11541135            $updated = wp_update_term($id, 'link_category', $_POST);
     
    11691150            if ( $updated && !is_wp_error($updated) ) {
    11701151                $tag = get_term( $updated['term_id'], $taxonomy );
    1171                 if ( !$tag || is_wp_error( $tag ) )
    1172                     die( __('Tag not updated.') );
    1173 
    1174                 echo _tag_row($tag, 0, '', $taxonomy);
     1152                if ( !$tag || is_wp_error( $tag ) ) {
     1153                    if ( is_wp_error($tag) && $tag->get_error_message() )
     1154                        die( $tag->get_error_message() );
     1155                    die( __('Item not updated.') );
     1156                }
     1157
     1158                echo _tag_row($tag, 0, $taxonomy);
    11751159            } else {
    1176                 die( __('Tag not updated.') );
     1160                if ( is_wp_error($updated) && $updated->get_error_message() )
     1161                    die( $updated->get_error_message() );
     1162                die( __('Item not updated.') );
    11771163            }
    11781164
Note: See TracChangeset for help on using the changeset viewer.