Custom Fields
Re-Envisioned
Support MB User Meta Multiple file_upload fields

This topic contains 4 replies, has 2 voices, and was last updated by  woorise 2 years, 2 months ago.

  • Creator
    Topic
  • #6736
    Resolved
    woorise
    Participant

    I am using two different upload fields (type: “file_upload”).

    On file upload is possible to know which one is used so I can change the upload folder path?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #6764

    Anh Tran
    Keymaster

    Can I ask how do you change upload folder? Do you use WordPress hooks?

    #6768

    woorise
    Participant

    Yes I am using upload_dir filter.

    #6772

    Anh Tran
    Keymaster

    I’m afraid this is a hard problem. As the file_upload uses Media Library to upload files, all it does is calling the popup, passing the required parameters for the uploader (mime types, file size, etc.) and parsing the returned data. I’ve just checked the code and couldn’t find anything related to the current field, because the uploader doesn’t need that. But can you try print_r everything global ($_POST, $_GET, etc.) when filtering? Probably I’m missing something.

    #6774

    woorise
    Participant

    I did it but I didn’t get any information that I could use.

    For now I am checking external conditions like user role, post taxonomies etc. but it would be useful if there was a more direct way related to the field.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.