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.
by Midweste · github.com/midweste/wp-lib-imagehooks · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/midweste/wp-lib-imagehooks/archive/refs/heads/main.zipDeclares an update source (https://api.github.com/repos/midweste/wp-image-hooks/commits/main), so updates arrive through the plugin's own updater.
From the readme
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.