From 2c516732de01dc2b1d9e380b62e17867f4d9e8d5 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 17 Sep 2008 00:04:02 +0000 Subject: [PATCH] Edit and Delete links for categories. see #7552 git-svn-id: http://svn.automattic.com/wordpress/trunk@8910 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 16e59857d7..11b6096823 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -80,8 +80,19 @@ function _cat_row( $category, $level, $name_override = false ) { $pad = str_repeat( '— ', $level ); $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); + $edit_link = "categories.php?action=edit&cat_ID=$category->term_id"; if ( current_user_can( 'manage_categories' ) ) { - $edit = "name)) . "'>$name"; + $edit = "name)) . "'>$name
"; + $actions = array(); + $actions['edit'] = '' . __('Edit') . ''; + $actions['delete'] = "term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $action_count = count($actions); + $i = 0; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + $edit .= "$link$sep"; + } } else { $edit = $name; }