• I’m creating a plugin where the user can select from a drop down the ‘image type’ of any images that they upload. I want to then save the file in a different location, depending on what they select in this list. Is this possible?

    For example, if the user uploads an image and selects ‘Enlargement’ from the ‘Image Type’ drop down, I’d like to save the image in:
    uploads/enlargement

    If they select ‘Thumbnail’ from the drop down, I’d like to save the image in: uploads/thumbnail etc

    I think I need to use the add_filter( 'upload_dir' , 'set_custom_upload_dir'); hook but I’m not sure if this is correct, and if it is how do I get the ‘Image Type’ that I set with my plugin?

  • The topic ‘Dynamically change media upload location’ is closed to new replies.