Implement attachmenet delete link. Use get_edit_post_link(). see #7552
git-svn-id: http://svn.automattic.com/wordpress/trunk@8895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cb6611d1f0
commit
168652f6c4
|
@ -92,13 +92,18 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||||
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
|
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
|
||||||
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
|
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
|
||||||
<p>
|
<p>
|
||||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
|
|
||||||
<a href="<?php the_permalink(); ?>"><?php _e('Get permalink'); ?></a> |
|
|
||||||
<a href="#" class="delete"><?php _e('Delete'); ?></a>
|
|
||||||
</p>
|
|
||||||
<?php do_action('manage_media_media_column', $post->ID); ?>
|
|
||||||
</td>
|
|
||||||
<?php
|
<?php
|
||||||
|
$actions = array();
|
||||||
|
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||||
|
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||||
|
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||||
|
$action_count = count($actions);
|
||||||
|
$i = 0;
|
||||||
|
foreach ( $actions as $action => $link ) {
|
||||||
|
++$i;
|
||||||
|
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
||||||
|
echo "<span class='$action'>$link$sep</span>";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tags':
|
case 'tags':
|
||||||
|
|
|
@ -762,7 +762,7 @@ function _post_row($a_post, $pending_comments, $mode) {
|
||||||
the_excerpt();
|
the_excerpt();
|
||||||
|
|
||||||
$actions = array();
|
$actions = array();
|
||||||
$actions['edit'] = '<a href="post.php?action=edit&post=' . $post->ID . '">' . __('Edit') . '</a>';
|
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||||
$actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
|
$actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
|
||||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&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>";
|
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&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>";
|
||||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||||
|
|
Loading…
Reference in New Issue