Make WordPress Core


Ignore:
Timestamp:
06/15/2021 04:50:49 PM (3 years ago)
Author:
davidbaumwald
Message:

Media: Ensure $post_ids is evaluated properly when processing bulk actions.

After [51111], the $post_ids variable is now initialized as an empty array when processing a bulk action. As such, the original check using isset on $post_ids will always evaluate to true. This change swaps the isset checks for empty to check array length instead.

Props david.binda, hellofromTonya.
Fixes #53411.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/upload.php

    r51111 r51161  
    149149
    150150        case 'trash':
    151             if ( ! isset( $post_ids ) ) {
     151            if ( empty( $post_ids ) ) {
    152152                break;
    153153            }
     
    170170            break;
    171171        case 'untrash':
    172             if ( ! isset( $post_ids ) ) {
     172            if ( empty( $post_ids ) ) {
    173173                break;
    174174            }
     
    185185            break;
    186186        case 'delete':
    187             if ( ! isset( $post_ids ) ) {
     187            if ( empty( $post_ids ) ) {
    188188                break;
    189189            }
Note: See TracChangeset for help on using the changeset viewer.