Skip to content

Commit 257edc7

Browse files
author
Michiel Verkoijen
committed
Fix bottom drop down menu in media library.
1 parent 30a7835 commit 257edc7

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/class-tiny-plugin.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public function admin_init() {
7878
$this->get_method( 'media_library_bulk_action' )
7979
);
8080

81+
add_action( 'admin_action_-1',
82+
$this->get_method( 'media_library_bulk_action' )
83+
);
84+
8185
add_filter( 'manage_media_columns',
8286
$this->get_method( 'add_media_columns' )
8387
);
@@ -319,7 +323,13 @@ public function ajax_optimization_statistics() {
319323
public function media_library_bulk_action() {
320324
check_admin_referer( 'bulk-media' );
321325

322-
if ( empty( $_REQUEST['media'] ) || ! is_array( $_REQUEST['media'] ) ) {
326+
if ( empty( $_REQUEST['action'] ) || (
327+
$_REQUEST['action'] != 'tiny_bulk_action' &&
328+
$_REQUEST['action2'] != 'tiny_bulk_action' ) ) {
329+
return;
330+
}
331+
332+
if ( empty( $_REQUEST['media'] ) || ( ! $_REQUEST['media'] ) ) {
323333
return;
324334
}
325335

0 commit comments

Comments
 (0)