From 463b5adba599ceb84eb9a6591db50aa208d26c5e Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 16 Sep 2008 22:43:01 +0000 Subject: [PATCH] Show Preview instead of View for unpublished posts and pages git-svn-id: http://svn.automattic.com/wordpress/trunk@8907 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 04c7796af..2aa72e080 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -765,7 +765,10 @@ function _post_row($a_post, $pending_comments, $mode) { $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') . ''; + if ( in_array($post->post_status, array('pending', 'draft')) ) + $actions['view'] = '' . __('Preview') . ''; + else + $actions['view'] = '' . __('View') . ''; $action_count = count($actions); $i = 0; foreach ( $actions as $action => $link ) { @@ -971,7 +974,10 @@ foreach ($posts_columns as $column_name=>$column_display_name) { $actions['edit'] = '' . __('Edit') . ''; $actions['inline'] = '' . __('Quick Edit') . ''; $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; - $actions['view'] = '' . __('View') . ''; + if ( in_array($post->post_status, array('pending', 'draft')) ) + $actions['view'] = '' . __('Preview') . ''; + else + $actions['view'] = '' . __('View') . ''; $action_count = count($actions); $i = 0; foreach ( $actions as $action => $link ) {