WordPress.org

Make WordPress Core

Changeset 8908


Ignore:
Timestamp:
09/16/08 23:17:03 (6 years ago)
Author:
ryan
Message:

Edit and Delete links for tags page. see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r8907 r8908  
    299299 
    300300        $name = apply_filters( 'term_name', $tag->name ); 
     301        $edit_link = "edit-tags.php?action=edit&tag_ID=$tag->term_id";  
    301302        $out = ''; 
    302303        $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; 
    303304        $out .= '<th scope="row" class="check-column"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></th>'; 
    304         $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)) . '">' . 
    305             $name . '</a></strong></td>'; 
     305        $out .= '<td><strong><a class="row-title" href="$edit_link" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' . $name . '</a></strong><br />'; 
     306        $actions = array(); 
     307        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 
     308        $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>"; 
     309        $action_count = count($actions); 
     310        $i = 0; 
     311        foreach ( $actions as $action => $link ) { 
     312            ++$i; 
     313            ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 
     314            $out .= "<span class='$action'>$link$sep</span>"; 
     315        } 
     316        $out .= '</td>'; 
    306317 
    307318        $out .= "<td class='num'>$count</td>"; 
Note: See TracChangeset for help on using the changeset viewer.