mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 10:09:47 +01:00
47f15ab10d
git-svn-id: http://svn.automattic.com/wordpress/trunk@2944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
25 lines
553 B
PHP
25 lines
553 B
PHP
<?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);
|
|
|
|
$cat_name = rawurldecode($_GET['ajaxnewcat']);
|
|
|
|
if ( !$category_nicename = sanitize_title($cat_name) )
|
|
die('0');
|
|
if ( $already = category_exists($cat_name) )
|
|
die((string) $already);
|
|
|
|
$new_cat_id = wp_create_category($cat_name);
|
|
die((string) $new_cat_id);
|
|
?>
|