X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/cc7b1505cd9fafd87c3672f669e13e98b0c544f7..refs/tags/wordpress-2.9:/wp-admin/categories.php diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 30d37c8b..9639281f 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -1,25 +1,20 @@ %s category: this is the default one"), $cat_name)); + wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_cat_name($cat_ID) ) ); wp_delete_category($cat_ID); - wp_redirect('categories.php?message=2'); + wp_safe_redirect( add_query_arg( 'message', 2, wp_get_referer() ) ); + exit; break; +case 'bulk-delete': + check_admin_referer('bulk-categories'); + + if ( !current_user_can('manage_categories') ) + wp_die( __('You are not allowed to delete categories.') ); + + $cats = (array) $_GET['delete']; + $default_cat = get_option('default_category'); + foreach ( $cats as $cat_ID ) { + $cat_ID = (int) $cat_ID; + + // Don't delete the default cat. + if ( $cat_ID == $default_cat ) + wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_cat_name($cat_ID) ) ); + + wp_delete_category($cat_ID); + } + + wp_safe_redirect( wp_get_referer() ); + exit; + +break; case 'edit': - require_once ('admin-header.php'); - $cat_ID = (int) $_GET['cat_ID']; - $category = get_category_to_edit($cat_ID); - ?> - -
-

-
- cat_ID); ?> - - - - - - - - - - - - - - - - - -
-
-
-

-
-

-
- - -

- - -
- -

add new)'), '#addcat') ?>

- -

- - +
+ +

' . __('Search results for “%s”') . '', esc_html( stripslashes($_GET['s']) ) ); ?> +

+ + +

+ + +
+ + +
+ +
+ +
+
+
+
+ + 0, 'search' => $_GET['s']))); +else + $num_cats = wp_count_terms('category'); + +$page_links = paginate_links( array( + 'base' => add_query_arg( 'pagenum', '%#%' ), + 'format' => '', + 'prev_text' => __('«'), + 'next_text' => __('»'), + 'total' => ceil($num_cats / $cats_per_page), + 'current' => $pagenum +)); + +if ( $page_links ) + echo "
$page_links
"; +?> + +
+ + + +
+ +
+
+ +
+ +
+ - - - - - + + + + + + + + + + +
+
+$page_links
"; +?> + +
+ + + +
+ +
+
+ + + +
+

Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?>

+

category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>

+
+ + + + +
+
+ + +parent = 0; do_action('add_category_form_pre', $category); ?> + +
+

+
+ + + +
+ + +

+
+
+ + +

- -
-

Note:
Deleting a category does not delete posts from that category, it will just set them back to the default category %s.'), get_catname(get_option('default_category'))) ?>

+
+ + 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?> +

-
-

- - -


-

-


-

-


-

-

- +
+ + +

- + +

+ +
+ + + +
+
+ +
+