From 56c8b5dad51330b378c44de12e05f4eb38e50b2c Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 11 Nov 2011 15:04:54 +0000 Subject: [PATCH] Check caps when showing media edit and attach links. Clean up formatting. Props kurtpayne, DH-Shredder, solarissmoke. fixes #17419 git-svn-id: https://develop.svn.wordpress.org/trunk@19252 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-media-list-table.php | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index f4948975b2..44f2b7907c 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -164,6 +164,7 @@ class WP_Media_List_Table extends WP_List_Table { $alt = ''; while ( have_posts() ) : the_post(); + $user_can_edit = current_user_can( 'edit_post', $post->ID ); if ( $this->is_trash && $post->post_status != 'trash' || !$this->is_trash && $post->post_status == 'trash' ) @@ -190,7 +191,11 @@ foreach ( $columns as $column_name => $column_display_name ) { case 'cb': ?> - ID ) ) { ?> + + + + + $column_display_name ) { ?> >ID, array( 80, 60 ), true ) ) { - if ( $this->is_trash ) { + if ( $this->is_trash || ! $user_can_edit ) { echo $thumb; } else { ?> @@ -216,7 +221,15 @@ foreach ( $columns as $column_name => $column_display_name ) { case 'title': ?> - >is_trash ) echo $att_title; else { ?> + > + is_trash || ! $user_can_edit ) { + echo $att_title; + } else { ?> + + +

ID ), $matches ) ) @@ -288,15 +301,25 @@ foreach ( $columns as $column_name => $column_display_name ) { $title =_draft_or_post_title( $post->post_parent ); } ?> - > - , + > + post_parent ) ) { ?> + + + , >
- + + + +