Support

Account

Home Forums Backend Issues (wp-admin) Detect which field is in use while uploading file Reply To: Detect which field is in use while uploading file

  • Hi @k12m

    This may not be possible with an ACF file / image field.

    There is no way to tell which field launched the uploader as this is all done with JS (PHP would not know…)

    Perhaps you could write some custom JS which listens to a click on the acf file field, when clicked, an AJAX call is sent to a PHP function which saves the field_name as a custom wp options (wp_options table).

    Then in your upload script, you could read the value from the wp_options table to find which was the last clicked field?

    It’s not pretty, but it would work