Home › Forums › ACF PRO › acf/validate_save_post on clone fields › Reply To: acf/validate_save_post on clone fields
Here is how I would work around this issue with the star field as an example. This will work for both cloned and non-cloned versions of the same field.
$field_key = 'field_5d49b2ff396b6';
foreach ($_POST['acf'] as $key => $value) {
if (substr($key, -strlen($field_key)) === $field_key) {
$start = new DateTime($value);
break;
}
}
If I was going to do this a lot then I’d probably build a function that searches the input to find the right value.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.