Make WordPress Core

Changeset 8130


Ignore:
Timestamp:
06/19/2008 10:31:58 PM (17 years ago)
Author:
ryan
Message:

crazyhorse: Add edit and delete links to excerpt view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/crazyhorse/wp-admin/edit-post-rows.php

    r8129 r8130  
    8484        <?php
    8585        if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); }
    86         if ( 'excerpt' == $mode )
     86        if ( 'excerpt' == $mode ) {
    8787            the_excerpt();
     88            $actions = array();
     89            $actions['edit'] = '<a href="post.php?action=edit&amp;post=' . $post->ID . '">' . __('Edit') . '</a>';
     90            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
     91            $action_count = count($actions);
     92            $i = 0;
     93            foreach ( $actions as $action => $link ) {
     94                ++$i;
     95                ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
     96                echo "<span class='$action'>$link$sep</span>";
     97            }
     98        }
    8899        ?>
    89100        </td>
Note: See TracChangeset for help on using the changeset viewer.