Home › Forums › Add-ons › Repeater Field › Delete repeater`s sub_field after expired date › Reply To: Delete repeater`s sub_field after expired date
Thank you for information, i have more questions now:
How i can querry and loop over all woocommerce products in functions.php?
I created cronjob, made it run one time per day:
add_action( 'triname_datas', 'triname_datas_func' );
function triname_datas_func() {
$today = date('Y-m-d');
$repeater = get_field('pasirinkti_datas');
// $repeater is an array of rows
$count = count($repeater);
for ($row=$count; $row>0; $row--) {
if (get_sub_field('keliones_datos', $repeater) >= $today) {
delete_row('pasirinkti_datas', $row);
}
}
}
But it is not working, i need to query and loop through products.
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.