Bricks Condition: Check Repeater
Check if ACF repeater has rows and content. Used for bricks display conditions.
Information
{acf_product_information}
function repeater_has_content($repeater_field, $subfield) {
// Check if the repeater field has any rows
if (have_rows($repeater_field)) {
// Loop through the rows
while (have_rows($repeater_field)) {
// Set the current row as active
the_row();
// Get the value of the sub-field
$subfield_value = get_sub_field($subfield);
// Check if the sub-field has content
if (!empty($subfield_value)) {
// If it has content, return true
return true;
}
}
}
// If no rows found or no sub-field has content, return false
return false;
}14 Day Money Back
If the component doesn’t work as expected or wasn’t what you thought it was you have 14 days from the date of purchase to submit a support request and I will refund you the full amount. NO QUESTIONS ASKED.