From f4366bf2422b133c3d61d2738817b97d84319878 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@8895 602fd350-edb4-49c9-b593-d223f7449a82 --- 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') . '';