mirror of
git://develop.git.wordpress.org/
synced 2025-03-23 05:20:01 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51161 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ba65211c29
commit
3beac35843
@ -148,7 +148,7 @@ if ( $doaction ) {
|
||||
break;
|
||||
|
||||
case 'trash':
|
||||
if ( ! isset( $post_ids ) ) {
|
||||
if ( empty( $post_ids ) ) {
|
||||
break;
|
||||
}
|
||||
foreach ( (array) $post_ids as $post_id ) {
|
||||
@ -169,7 +169,7 @@ if ( $doaction ) {
|
||||
);
|
||||
break;
|
||||
case 'untrash':
|
||||
if ( ! isset( $post_ids ) ) {
|
||||
if ( empty( $post_ids ) ) {
|
||||
break;
|
||||
}
|
||||
foreach ( (array) $post_ids as $post_id ) {
|
||||
@ -184,7 +184,7 @@ if ( $doaction ) {
|
||||
$location = add_query_arg( 'untrashed', count( $post_ids ), $location );
|
||||
break;
|
||||
case 'delete':
|
||||
if ( ! isset( $post_ids ) ) {
|
||||
if ( empty( $post_ids ) ) {
|
||||
break;
|
||||
}
|
||||
foreach ( (array) $post_ids as $post_id_del ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user