Changeset 13088 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 02/13/2010 06:04:54 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r13086 r13088 1132 1132 1133 1133 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 else1150 die( __('Category not updated.') );1151 1152 break;1153 1134 case 'link-cat' : 1154 1135 $updated = wp_update_term($id, 'link_category', $_POST); … … 1169 1150 if ( $updated && !is_wp_error($updated) ) { 1170 1151 $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); 1175 1159 } 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.') ); 1177 1163 } 1178 1164
Note: See TracChangeset
for help on using the changeset viewer.