Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger hook on image replacement #127

Open
cssjoe opened this issue Nov 4, 2021 · 1 comment
Open

Trigger hook on image replacement #127

cssjoe opened this issue Nov 4, 2021 · 1 comment

Comments

@cssjoe
Copy link
Member

cssjoe commented Nov 4, 2021

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
Copy link
Member

nicolepaschen commented Nov 18, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants