[wp-trac] [WordPress Trac] #44990: Unhandle post_ids variable in custom bulk actions
WordPress Trac
noreply at wordpress.org
Wed Oct 3 19:13:06 UTC 2018
#44990: Unhandle post_ids variable in custom bulk actions
--------------------------------------+------------------------------
Reporter: gaupoit | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9.8
Severity: minor | Resolution:
Keywords: dev-feedback ux-feedback | Focuses:
--------------------------------------+------------------------------
Changes (by garrett-eclipse):
* keywords: dev-feedback => dev-feedback ux-feedback
Comment:
Thanks @gaupoit welcome to Trac.
This seems to coincide with #45006 to handle Bulk Actions when no items
selected.
When reviewing this it appears the `trash`, `untrash` and `delete` actions
in the switch case all do isset checks on $post_ids; [[BR]]
https://github.com/WordPress/WordPress/blob/master/wp-
admin/upload.php#L149 [[BR]]
https://github.com/WordPress/WordPress/blob/master/wp-
admin/upload.php#L170 [[BR]]
https://github.com/WordPress/WordPress/blob/master/wp-
admin/upload.php#L185
So in the interim you can update your custom code to similarly check
$post_ids and simply `return $location;`;[[BR]]
{{{#!php
<?php
if ( ! isset( $post_ids ) ) {
return $location;
}
}}}
And for easy reference as the code you referred to is no longer on line
170 in master here's a permalink to 4.9.8;
https://github.com/WordPress/WordPress/blob/4.9.8/wp-admin/upload.php#L170
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44990#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list