Support

Account

Home Forums ACF PRO IF SubField of Repeater(A) matches SubField of Repeater(B), GET all SubFields(B) Reply To: IF SubField of Repeater(A) matches SubField of Repeater(B), GET all SubFields(B)

  • There isn’t going to be an easy way to do something like this. You are going to need to get all of the values from the repeaters of both posts and compare them.

    I would put them into arrays and then loop through both arrays.

    
    $match_found = false;
    foreach ($repeater_1 as $repeater_row_1) {
        foreach ($repeater_2 as $repeater_row_2) {
            // check if they are == here
            // if they are set match found to true
            $match_found = true;
            // if you want, when a match is found you ca break
            // out of this loop
            if ($match_found) {
                break;
            }
        }
        // you can do it again here
        if ($match_found) {
            break;
        }
    

    }