WordPress filter hook
imagify_site_root
Defined by Imagify Image Optimization: Optimize Images and fired by 2 plugins in total, running on 900K+ sites between them.
“Filter the path to the site's root.”
How to use imagify_site_root
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'imagify_site_root', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from Imagify Image Optimization: Optimize Images's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
2 plugins that fire imagify_site_root
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Imagify Image Optimization: Optimize Images900,000+ installs
apply_filters( 'imagify_site_root', null )inc/classes/class-imagify-filesystem.php:791 -
AIO Performance Profiler, Monitor, Optimize, Compress & Debug10+ installs
apply_filters( 'imagify_site_root', null )image-optimization/image-optimization.php:649
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.