javascript – Update displayed File URL in Media Library modal when it’s changed


I’ve added a Select custom field for all Attachments using Advanced Custom Fields plugin.

When user selects something in that field, the attachment file is moved to a sub-folder, so the path changes from wp-content/uploads/file.jpg to wp-content/uploads/protected/file.jpg. Is there a way to reflect that change immediately in the File URL, without reloading the page?

I noticed there’s an AJAX call being made when the changes are saved. It returns a JSON with the new URL but I couldn’t figure out a way to hook to that data.

enter image description here

abiadi 4 months 2021-07-22T08:48:46-05:00 0 Answers 0 views 0

Leave an answer