Hide custom fields in review widget when empty
-
I used the following code to add a custom field, which I changed to checkbox. This checkbox is optional and I’ve changed the review.php to add this custom field in the review widget. But when I leave the checkbox unchecked, it just displays {{ my_custom_field }}. I tried to modify the foreach loop in the last function from the code snippet but I can’t manage to find a solution to get these reviews with the checkbox unchecked. Is there something I can do in review.php or should this be done in PHP? I have a “solution” in CSS but it isn’t enough, I would prefer to not write out the value when I leave the checkbox unchecked. Thanks!
The topic ‘Hide custom fields in review widget when empty’ is closed to new replies.