• Resolved lumpelem

    (@lumpelem)


    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)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Hi @lumpelem,

    thanks for the message! We’ll take a look into this.

    PS. We have a repo here: https://github.com/BracketSpace/Easy-Watermark

    Thread Starter lumpelem

    (@lumpelem)

    Hi,

    just a quick follow-up, it seems the bulk action only fail if you use the list view for the media items and works correctly on with the grid view, this makes my solution a bad one, you probably just need to trigger the same methods from the list view as you do from the grid one (if that’s possible).

    Thread Starter lumpelem

    (@lumpelem)

    I will move this whole thing to a GitHub issue as working solely in the Media/Library Grid view works perfectly fine!

    I tried a handful of watermark plugins and yours is miles ahead of everything else! No bloated features, code is clean and clever and works like a charm outside of a few edge cases.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    This is really interesting. I’ve planned the maintenance sprint with this plugin in the next week.

    PS. You might be interested in the PRO version which will have a completely new visual editor, multiple layers and cloud processing. We’ll be releasing it this quarter ??

    Plugin Author Kuba Mikita

    (@kubitomakita)

    We just released version 1.0.6 which fixes this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Media “Bulk Restore original images” dosn’t work’ is closed to new replies.