Coding Standards: Use strict comparison in wp-admin/includes/class-wp-media-list-table.php.

Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50770


git-svn-id: http://core.svn.wordpress.org/trunk@50379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-04-19 11:41:07 +00:00
parent 0cbb526928
commit 596b9ed6ce
2 changed files with 9 additions and 2 deletions

View File

@ -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';
?>
<tr id="post-<?php echo $post->ID; ?>" class="<?php echo trim( ' author-' . $post_owner . ' status-' . $post->post_status ); ?>">
<?php $this->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(
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',
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(
'<a href="%s" aria-label="%s" rel="bookmark">%s</a>',

View File

@ -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.