Oh, I completely missed this! I’m so sorry. Thanks so much for your help. The formatting got a bit wonky but I fixed it up as best as I could and ended up with this code:
add_action('acf/save_post', 'remove_att_from_att');
function remove_att_from_att($post_id) {
$post_type = get_post_type($post_id);
if ($post_type != 'attachment') {
return;
}
$children = get_children($post_id);
if ($children) {
// remove filter so this filter does not run again
remove_filter('acf/save_post', 'remove_att_from_att');
foreach ($children as $child) {
$child->parent = 0;
wp_update_post($child);
}
// restore filter
add_action('acf/save_post', 'remove_att_from_att');
}
}
Which, unfortunately, didn’t work; the images still get attached every time I save a post. Did I make a mistake with my tweaks or is there something else missing?
I asked support for assistance and they suggested: “You can make use of the acf/save_post filter to detach any media from the post.”
I’m not a programmer so I have no idea where to start with that, but I thought I’d share it in case it’s useful to you.
I’ll let you know if I ever figure out a solution.
I’m running into the same problem; did you ever find a fix for this?
This reply has been marked as private.
Adding my voice to the chorus. I’ve been trying tons of tab setups with the repeater and none of them work quite right. Having one that’s ACF-backed would be great.