X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8a06f4f9392d1ac373442f82ee40428a3cb81395..672d6bc6da735e745275ef7a86341dc1178da8d2:/wp-admin/edit-link-categories.php?ds=sidebyside diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index c7a5e9d9..691f3266 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -1,43 +1,54 @@ %s category: this is the default one"), $cat_name)); + if ( 'delete' == $doaction ) { + foreach( (array) $_GET['delete'] as $cat_ID ) { + $cat_name = get_term_field('name', $cat_ID, 'link_category'); + $default_cat_id = get_option('default_link_category'); - wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); - } + // Don't delete the default cats. + if ( $cat_ID == $default_cat_id ) + wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); - $location = 'edit-link-categories.php'; - if ( $referer = wp_get_referer() ) { - if ( false !== strpos($referer, 'edit-link-categories.php') ) - $location = $referer; - } + wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); + } + + $location = 'edit-link-categories.php'; + if ( $referer = wp_get_referer() ) { + if ( false !== strpos($referer, 'edit-link-categories.php') ) + $location = $referer; + } - $location = add_query_arg('message', 6, $location); - wp_redirect($location); - exit(); -} elseif ( !empty($_GET['_wp_http_referer']) ) { - wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + $location = add_query_arg('message', 6, $location); + wp_redirect($location); + exit(); + } +} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { + wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; } $title = __('Link Categories'); -$parent_file = 'edit.php'; -wp_enqueue_script( 'admin-categories' ); -wp_enqueue_script('admin-forms'); +wp_enqueue_script('admin-categories'); +if ( current_user_can('manage_categories') ) + wp_enqueue_script('inline-edit-tax'); require_once ('admin-header.php'); @@ -46,42 +57,48 @@ $messages[2] = __('Category deleted.'); $messages[3] = __('Category updated.'); $messages[4] = __('Category not added.'); $messages[5] = __('Category not updated.'); -$messages[6] = __('Categories deleted.'); +$messages[6] = __('Categories deleted.'); ?> + +
+ +

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

-if (isset($_GET['message'])) : ?> -

+ +

-
- -
- -

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

- -

- - -

- - - + +

- +

+
+ +
+
+
add_query_arg( 'pagenum', '%#%' ), 'format' => '', + 'prev_text' => __('«'), + 'next_text' => __('»'), 'total' => ceil(wp_count_terms('link_category') / $catsperpage), 'current' => $pagenum )); @@ -90,25 +107,33 @@ if ( $page_links ) echo "
$page_links
"; ?> -
- +
+ +

-
+
- +
- - - - + + + + + + + +
-
- $page_links
"; ?> + +
+ + +
+

+ +
+

Note:
Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category %s.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?>

- -
-

Note:
Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category %s.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?>

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

+
+
+ + + +
+ +
- +
+ + +

+
+ +
+ + +
+ +

+ +
+
+ + + +
+
- +
+
+