This function is still alive and works fine.
“Maybe you can copy the files to the new location, get the URL to the new location and then delete the attachment by using the wp_delete_attachment() function?”
“Maybe you can copy the files to the new location”
-> this works fine.
“get the URL to the new location”
-> I have the url.
“and then delete the attachment by using the wp_delete_attachment() function”
-> I wanted to do so when nothing works. I create so but a lot IDs in wp_posts. I was looking for a better solution.
I wanted to do this with a filter for “save_post”. I delete first the attachment from the media library and then i overwrite the attachment_id with the url of to the new location. Right?
excuse my bad English.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.