From e1e5e2b3977c18c800377e5707ef31bacdb9938e Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 2 Oct 2008 04:34:52 +0000 Subject: [PATCH] Hide Edit, Quick Edit, Delete links for people who cannot use them. Hide Quick Edit for people without JavaScript git-svn-id: https://develop.svn.wordpress.org/trunk@9058 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index cc95ca0858..1243f77967 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1246,9 +1246,11 @@ function _post_row($a_post, $pending_comments, $mode) { the_excerpt(); $actions = array(); - $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') . ""; + if ( current_user_can('edit_post', $post->ID) ) { + $actions['edit'] = '' . __('Edit') . ''; + $actions['inline hide-if-no-js'] = '' . __('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') . ""; + } if ( in_array($post->post_status, array('pending', 'draft')) ) $actions['view'] = '' . __('Preview') . ''; else