X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/38ca813a0e312e2768e5b9519f0415cd0aa84781..9c2096d803812dacbdf6cf8efe90053e39f00b96:/wp-admin/includes/class-wp-media-list-table.php
diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php
index 531fe60f..9c63ca32 100644
--- a/wp-admin/includes/class-wp-media-list-table.php
+++ b/wp-admin/includes/class-wp-media-list-table.php
@@ -84,13 +84,11 @@ class WP_Media_List_Table extends WP_List_Table {
}
function extra_tablenav( $which ) {
- global $post_type;
- $post_type_obj = get_post_type_object( $post_type );
?>
detached && !$this->is_trash ) {
- $this->months_dropdown( $post_type );
+ $this->months_dropdown( 'attachment' );
do_action( 'restrict_manage_posts' );
submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
@@ -137,7 +135,8 @@ class WP_Media_List_Table extends WP_List_Table {
/* translators: column name */
if ( !$this->detached ) {
$posts_columns['parent'] = _x( 'Attached to', 'column name' );
- $posts_columns['comments'] = '
';
+ if ( post_type_supports( 'attachment', 'comments' ) )
+ $posts_columns['comments'] = '
';
}
/* translators: column name */
$posts_columns['date'] = _x( 'Date', 'column name' );
@@ -163,6 +162,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' )
@@ -189,7 +189,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 {
?>
@@ -215,7 +219,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 ) )
@@ -287,15 +299,25 @@ foreach ( $columns as $column_name => $column_display_name ) {
$title =_draft_or_post_title( $post->post_parent );
}
?>
- | >
- ,
+ | >
+ post_parent ) ) { ?>
+
+
+ ,
|
>
- |
+
+
+
+