X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..9b5673a7aae863ab45c3b73460060352c5b3810b:/wp-admin/edit-link-categories.php diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index 691f3266..711121be 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -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’t delete the %s category: this is the default one"), $cat_name)); + wp_die( sprintf( __("Can’t delete the %s 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, '

' . __('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.') . '

' . + '

' . __('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.') . '

' . + '

' . __('For more information:') . '

' . + '

' . __('Link Categories Documentation') . '

' . + '

' . __('Support Forums') . '

' +); + require_once ('admin-header.php'); $messages[1] = __('Category added.'); @@ -67,7 +75,7 @@ if ( isset($_GET['s']) && $_GET['s'] ) -

+

@@ -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 )
- +
- +
- +

- +
- + +

@@ -224,5 +233,5 @@ if ( $page_links ) - - + +