BoldGrid / boldgrid-inspirations

The BoldGrid Inspirations core plugin for WordPress.
https://www.boldgrid.com/
GNU General Public License v2.0
11 stars 12 forks source link

Trigger hook on image replacement #127

Open cssjoe opened 2 years ago

cssjoe commented 2 years ago

Is your feature request related to a problem? Please describe. Some plugins rely on the "add_attachment" action/hook when an image is added. For example, when an image optimization plugin needs to take action on a new image upload.

Describe the solution you'd like Call the following code when replacing a watermarked image with a purchased one:

do_action( 'add_attachment', $post_ID );

The $post_ID is the attachment/post ID number.

nicolepaschen commented 2 years ago

I have auto convert enabled. I went into a page and changed an image to one I found using BG Connect Search. When I look in the media library it says it’s converted but the jpeg still goes out when I look at the Network tab of dev tools.

I also tried finding the image and converting it first, then adding it to a page. I still don’t see it served in webp.

I used Unsplash and Flickr images.

image