Hi Elliot, having a real hard time with this. I've got this working as a manually defined prototype so I'm sure the logic is correct, but no joy whenever I try to define my variable with a repeater.
So, the code is ` //Pull in exceptions from ACF Options Page fields //Want to filter out all past exceptions and add them to an array - can't seem to run through them with a foreach
$oh_exceptions = get_field('opening_exceptions', 'option');
$oh_future_exceptions = array();
foreach($oh_exceptions as $oh_exception):
if($oh_exception['date'] >= $oh_today_date):
$oh_future_exceptions[] = array('date'=>$oh_exception['date'], 'exception_type'=>$oh_exception['exception_type']);
endif;
endforeach;
As I said, I've had this working with a manually defined multi-dimensional array
$oh_exceptions = array( '0' => array( 'date' => 20130607 , 'exception_type' => 'closed' ) ,
'1' => array( 'date' => 20130531 , 'exception_type' => 'closed' ) ,
'2' => array( 'date' => 20130826 , 'exception_type' => 'bankholiday' ) ,
'3' => array( 'date' => 20131223 , 'exception_type' => 'bankholiday' ) ,
'4' => array( 'date' => 20131224 , 'exception_type' => 'closed' ) ;
`
and all works as expected. To be clear, the repeater is on the options page and this code is in functions.php.
Went digging around the forum with no luck, so apologies if this something obvious. Thanks in advance.