Improvement – filter for images uploaded via media_sideload_image
-
Hello,
First of all, great plugin! Congratulations, it is a must have for all the websites that I develop and manage.Recently, I did a project that upload an image via URL with the
media_sideload_image
function. Just right now I realized that your plugin doesn’t filter the name of the images when uploaded via this function.Tweaking you plugin code, in the file
clean-image-filenames.php
in the line 58, if you add:
add_action( 'wp_handle_sideload_prefilter', array( $this, 'upload_filter' ) );
It will handle the filename of the images that are uploaded with media_sideload_image function.I’ll be glad if you do this modification.
Thank you,
LuizReference:
Themedia_sideload_image
function docs:
https://developer.www.ads-software.com/reference/functions/media_sideload_image/The above function use
media_handle_sideload
function:
https://developer.www.ads-software.com/reference/functions/media_handle_sideload/Which can be modified with
wp_handle_sideload_prefilter
:
https://developer.www.ads-software.com/reference/hooks/action_prefilter/
- The topic ‘Improvement – filter for images uploaded via media_sideload_image’ is closed to new replies.