diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php
index 3634c30499..872591b312 100644
--- a/wp-admin/includes/class-wp-media-list-table.php
+++ b/wp-admin/includes/class-wp-media-list-table.php
@@ -648,12 +648,14 @@ class WP_Media_List_Table extends WP_List_Table {
while ( have_posts() ) :
the_post();
+
if ( $this->is_trash && 'trash' !== $post->post_status
|| ! $this->is_trash && 'trash' === $post->post_status
) {
continue;
}
- $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
+
+ $post_owner = ( get_current_user_id() === (int) $post->post_author ) ? 'self' : 'other';
?>
single_row_columns( $post ); ?>
@@ -691,6 +693,7 @@ class WP_Media_List_Table extends WP_List_Table {
__( 'Edit' )
);
}
+
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
$actions['trash'] = sprintf(
@@ -712,6 +715,7 @@ class WP_Media_List_Table extends WP_List_Table {
);
}
}
+
$actions['view'] = sprintf(
'%s',
get_permalink( $post->ID ),
@@ -739,6 +743,7 @@ class WP_Media_List_Table extends WP_List_Table {
__( 'Edit' )
);
}
+
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( $this->is_trash ) {
$actions['untrash'] = sprintf(
@@ -757,6 +762,7 @@ class WP_Media_List_Table extends WP_List_Table {
_x( 'Trash', 'verb' )
);
}
+
if ( $this->is_trash || ! EMPTY_TRASH_DAYS || ! MEDIA_TRASH ) {
$delete_ays = ( ! $this->is_trash && ! MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
$actions['delete'] = sprintf(
@@ -769,6 +775,7 @@ class WP_Media_List_Table extends WP_List_Table {
);
}
}
+
if ( ! $this->is_trash ) {
$actions['view'] = sprintf(
'%s',
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 64136942bf..02097108ca 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.8-alpha-50769';
+$wp_version = '5.8-alpha-50770';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.