I'm new in wordpress plugin development and I'm trying to hook my function to one of wordpress's upload / attachements functions. My target is to: - hook to wordpress function (I've tried: wp_handle_upload, wp_handle_upload_prefilter) - use image/media resource in my function (apply filter on image) - return modified resource to further processing by wordpress core.
Is there a way to achieve that?
The code I'm using is similar to:
add_filter('wp_handle_upload', 'handle_upload');
function handle_upload($resource){
$tools->tool_blurImage($resource);
return $resource;
}
Thanks in advance!