diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-22 18:31:50 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-22 18:31:50 +0000 |
commit | d48e85e0ac5e675ca33fac173f30c75403d1033f (patch) | |
tree | 1164430fa3b83a4d9283961b09c1576f2885e6b2 /wp-admin/edit-form-ajax-cat.php | |
parent | 086dcde66603301531efc6d8087bd06d0546f148 (diff) | |
download | wordpress-mu-d48e85e0ac5e675ca33fac173f30c75403d1033f.tar.gz wordpress-mu-d48e85e0ac5e675ca33fac173f30c75403d1033f.tar.xz wordpress-mu-d48e85e0ac5e675ca33fac173f30c75403d1033f.zip |
Moved everything in wp-inst down a directory.
Uses's Ryan Boren's htaccess rules and mods
If you're upgrading, try this on a test server first!
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@591 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/edit-form-ajax-cat.php')
-rw-r--r-- | wp-admin/edit-form-ajax-cat.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/wp-admin/edit-form-ajax-cat.php b/wp-admin/edit-form-ajax-cat.php new file mode 100644 index 0000000..4a4665c --- /dev/null +++ b/wp-admin/edit-form-ajax-cat.php @@ -0,0 +1,37 @@ +<?php +require_once('../wp-config.php'); +require_once('admin-functions.php'); +require_once('admin-db.php'); + +get_currentuserinfo(); + +if ( !current_user_can('manage_categories') ) + die('-1'); + +function get_out_now() { exit; } + +add_action('shutdown', 'get_out_now', -1); + +$names = explode(',', rawurldecode($_GET['ajaxnewcat']) ); +$ids = array(); + +foreach ($names as $cat_name) { + $cat_name = trim( $cat_name ); + + if ( !$category_nicename = sanitize_title($cat_name) ) + continue; + if ( $already = category_exists($cat_name) ) { + $ids[] = (string) $already; + continue; + } + + $new_cat_id = wp_create_category($cat_name); + + $ids[] = (string) $new_cat_id; +} + +$return = join(',', $ids); + +die( (string) $return ); + +?> |