]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/edit-link-categories.php
Wordpress 3.0.6
[autoinstalls/wordpress.git] / wp-admin / edit-link-categories.php
index 691f326697dd06dca856ab23794cced2c6915c08..711121be1743d2c8f808016c74964c3195da674b 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 /** WordPress Administration Bootstrap */
-require_once('admin.php');
+require_once('./admin.php');
 
 // Handle bulk actions
 if ( isset($_GET['action']) && isset($_GET['delete']) ) {
@@ -18,13 +18,14 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) {
                wp_die(__('Cheatin’ uh?'));
 
        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');
+               $cats = (array) $_GET['delete'];
+               $default_cat_id = get_option('default_link_category');
 
+               foreach( $cats as $cat_ID ) {
+                       $cat_ID = (int) $cat_ID;
                        // Don't delete the default cats.
                        if ( $cat_ID == $default_cat_id )
-                               wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
+                               wp_die( sprintf( __("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) );
 
                        wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
                }
@@ -39,7 +40,7 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) {
                wp_redirect($location);
                exit();
        }
-} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
+} elseif ( ! empty($_GET['_wp_http_referer']) ) {
         wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
         exit;
 }
@@ -50,6 +51,13 @@ wp_enqueue_script('admin-categories');
 if ( current_user_can('manage_categories') )
        wp_enqueue_script('inline-edit-tax');
 
+add_contextual_help($current_screen, '<p>' . __('You can create groups of links by using link categories. Link category names must be unique and link categories are separate from the categories you use for posts.') . '</p>' .
+       '<p>' . __('You can delete link categories, but that action does not delete the links within the category. Instead, it moves them to the default link category.') . '</p>' .
+       '<p><strong>' . __('For more information:') . '</strong></p>' .
+       '<p>' . __('<a href="http://codex.wordpress.org/Links_Link_Categories_SubPanel" target="_blank">Link Categories Documentation</a>') . '</p>' .
+       '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+);
+
 require_once ('admin-header.php');
 
 $messages[1] = __('Category added.');
@@ -67,7 +75,7 @@ if ( isset($_GET['s']) && $_GET['s'] )
 </h2>
 
 <?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
-<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>
+<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
 endif; ?>
 
@@ -91,7 +99,7 @@ endif; ?>
 $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
 if ( empty($pagenum) )
        $pagenum = 1;
-if( ! isset( $catsperpage ) || $catsperpage < 0 )
+if ( ! isset( $catsperpage ) || $catsperpage < 0 )
        $catsperpage = 20;
 
 $page_links = paginate_links( array(
@@ -197,18 +205,19 @@ if ( $page_links )
 
 <div class="form-field form-required">
        <label for="name"><?php _e('Link Category name') ?></label>
-       <input name="name" id="name" type="text" value="" size="40" aria-required="true" />
+       <input name="name" id="link-name" type="text" value="" size="40" aria-required="true" />
 </div>
-
+<?php if ( !global_terms_enabled() ) { ?>
 <div class="form-field">
        <label for="slug"><?php _e('Link Category slug') ?></label>
-       <input name="slug" id="slug" type="text" value="" size="40" />
+       <input name="slug" id="link-slug" type="text" value="" size="40" />
        <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
 </div>
-
+<?php } ?>
 <div class="form-field">
        <label for="description"><?php _e('Description (optional)') ?></label>
-       <textarea name="description" id="description" rows="5" cols="40"></textarea>
+       <textarea name="description" id="link-description" rows="5" cols="40"></textarea>
+       <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
 </div>
 
 <p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
@@ -224,5 +233,5 @@ if ( $page_links )
 </div><!-- /col-container -->
 </div><!-- /wrap -->
 
-<?php inline_edit_term_row('edit-link-categories'); ?>
-<?php include('admin-footer.php'); ?>
+<?php inline_edit_term_row('edit-link-categories', 'link_category'); ?>
+<?php include('./admin-footer.php'); ?>