• Resolved ultravibe

    (@ultravibe)


    Are there any actions or filters> I have a custom plugin that automates feeds of posts coming in, and the imported posts occasionally have image attachments. Would be nice to add an action to my plugin to fire off compression when there is an image import. Any way to do this?

    https://ww.wp.xz.cn/plugins/ewww-image-optimizer/

Viewing 1 replies (of 1 total)
  • Plugin Author Shane Bishop

    (@nosilver4u)

    You can just call the core ewww_image_optimizer() function after the import. There are a bunch of optional parameters, but the only required one is the full filename as the first parameter, so it would look something like this:

    ewww_image_optimizer( '/home/user/www/wp-content/custom_uploads/my_awesome_image.jpg' );

Viewing 1 replies (of 1 total)

The topic ‘Hooks for the plugin?’ is closed to new replies.