Media “Bulk Restore original images” dosn’t work
-
Hi,
I found that using the “Bulk Restore original images” action under the Media/Library didn’t have any effect. Looking at the code/documentation I couldn’t find any function linked to this action (please correct me if I missed something).
I didn’t find the code on github so I can’t create a pull request but here is a dirty quick solution for this specific problem.
easy-watermark/src/classes/Watermark/Hooks.php
/** * Adds bulk action handling * * @filter handle_bulk_actions-upload * * @param string $redirect The redirect URL. * @param string $doaction The action being taken. * @param array $object_ids The items to take the action on. * @return string $redirect */ public function handle_bulk_actions($redirect, $doaction, $object_ids) { if ( $doaction == 'restore' ) { foreach ( $object_ids as $attachment_id ) { $meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); $this->handler->restore_backup( $attachment_id, $meta ); } } return $redirect; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Media “Bulk Restore original images” dosn’t work’ is closed to new replies.