Edit and Delete links for tags page. see #7552

git-svn-id: http://svn.automattic.com/wordpress/trunk@8908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-09-16 23:17:03 +00:00
parent 463b5adba5
commit 4a5da512e2
1 changed files with 13 additions and 2 deletions

View File

@ -298,11 +298,22 @@ function _tag_row( $tag, $class = '' ) {
$count = ( $count > 0 ) ? "<a href='edit.php?tag=$tag->slug'>$count</a>" : $count;
$name = apply_filters( 'term_name', $tag->name );
$edit_link = "edit-tags.php?action=edit&amp;tag_ID=$tag->term_id";
$out = '';
$out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>';
$out .= '<th scope="row" class="check-column"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></th>';
$out .= '<td><strong><a class="row-title" href="edit-tags.php?action=edit&amp;tag_ID=' . $tag->term_id . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' .
$name . '</a></strong></td>';
$out .= '<td><strong><a class="row-title" href="$edit_link" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />';
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
$action_count = count($actions);
$i = 0;
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
$out .= "<span class='$action'>$link$sep</span>";
}
$out .= '</td>';
$out .= "<td class='num'>$count</td>";
$out .= '</tr>';