WordPress Image Hooks
Hook library for allowing external plugins to rewrite the image src of images, srcsets, and other images. Designed to be a helper library for Cloudflare Image Resizer and Glide. WordpressImageHooks handles the logic for hooking into WordPress functions and WordpressImageHooksImage handles the logic for rewriting the image src.
★ 0stars
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/midweste/wp-lib-imagehooks/archive/refs/heads/main.zipUpdates itself. It ships its own updater (Update URI header), so new versions appear under Dashboard → Updates.
Wordpress Image Hooks
Hook library for allowing external plugins to rewrite the image src of images, srcsets, and other images. Designed to be a helper library for Cloudflare Image Resizer and Glide.
WordpressImageHooks handles the logic for hooking into WordPress functions and WordpressImageHooksImage handles the logic for rewriting the image src.
To Install
composer require midweste/wp-lib-image-hooks
Implementation
Extend WordpressImageHooks and WordpressImageHooksImage to implement your own rewriting logic.
Configuration
By default, the settings are below and available via filter imagehooksimageresizesettings.
Filters
applyfilters('imagehooksimageresizesettings', $settings)
Array. This filter allows you to change default settings.
applyfilters('imagehooksimageprocessingenabled', true)
Boolean. This filter will allow you to add custom logic to exclude or prevent image src rewriting.