Changeset 3135 for trunk/wp-admin/edit-form-ajax-cat.php
- Timestamp:
- 11/17/2005 10:23:35 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-ajax-cat.php
r3061 r3135 13 13 add_action('shutdown', 'get_out_now', -1); 14 14 15 $cat_name = rawurldecode($_GET['ajaxnewcat']); 15 $names = explode(',', rawurldecode($_GET['ajaxnewcat']) ); 16 $ids = array(); 16 17 17 if ( !$category_nicename = sanitize_title($cat_name) ) 18 die('0'); 19 if ( $already = category_exists($cat_name) ) 20 die((string) $already); 18 foreach ($names as $cat_name) { 19 $cat_name = trim( $cat_name ); 20 21 if ( !$category_nicename = sanitize_title($cat_name) ) 22 continue; 23 if ( $already = category_exists($cat_name) ) { 24 $ids[] = (string) $already; 25 continue; 26 } 27 28 $new_cat_id = wp_create_category($cat_name); 29 30 $ids[] = (string) $new_cat_id; 31 } 21 32 22 $new_cat_id = wp_create_category($cat_name); 23 die((string) $new_cat_id); 33 $return = join(',', $ids); 34 35 die( (string) $return ); 36 24 37 ?>
Note: See TracChangeset
for help on using the changeset viewer.