Media: Ensure that post_id variable is initiated ahead of usage.

This prevents warnings when using custom bulk actions in the media library.

Props gitlost, achbed, Boniu91, wpgurudev, hellofromTonya.

Fixes #39589.


git-svn-id: https://develop.svn.wordpress.org/trunk@51111 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock
2021-06-08 22:06:32 +00:00
parent cea3994d29
commit 3f41775f27
2 changed files with 6 additions and 5 deletions

View File

@@ -119,6 +119,7 @@ $doaction = $wp_list_table->current_action();
if ( $doaction ) {
check_admin_referer( 'bulk-media' );
$post_ids = array();
if ( 'delete_all' === $doaction ) {
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );