From 168652f6c47dd23fafdb2ff5f82ab42ca82cc388 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 15 Sep 2008 19:28:26 +0000 Subject: [PATCH] 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 --- wp-admin/edit-attachment-rows.php | 17 +++++++++++------ wp-admin/includes/template.php | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 777a70df70..a79dfef52a 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -92,13 +92,18 @@ foreach ($posts_columns as $column_name => $column_display_name ) { >">
ID))); ?>

- "> | - | - -

- ID); ?> - ID, true) . '">' . __('Edit') . ''; + $actions['delete'] = "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') . ""; + $actions['view'] = '' . __('View') . ''; + $action_count = count($actions); + $i = 0; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + echo "$link$sep"; + } break; case 'tags': diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 63d4ccdae2..c7467921c2 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -762,7 +762,7 @@ function _post_row($a_post, $pending_comments, $mode) { the_excerpt(); $actions = array(); - $actions['edit'] = '' . __('Edit') . ''; + $actions['edit'] = '' . __('Edit') . ''; $actions['inline'] = '' . __('Quick Edit') . ''; $actions['delete'] = "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') . ""; $actions['view'] = '' . __('View') . '';