mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@50770 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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>',
|
||||
|
||||
Reference in New Issue
Block a user