I’m not sure I understand the purpose of such a feature. If the accordion is going to be empty, why include it at all?
Imagine they are used as containers for: gallery, video, Google Map, Info, something-else, etc.. Data is provided by and via Advanced Custom Fields.
And imagine some Posts wont have for example Google Map. Or Video, or something-else
I am talking about hardcoding accordion shortcode in PHP template. Not using it via TinyMce.
All of it is done, just wonder how difficult is to hide empty accordion shortcode.
If you’re coding them all with PHP and custom fields, why not just check for the existence of the custom field with something like this:
<?php if ($custom_field) {
// insert the accordion
} ?>
Ooo, thank you. So simple.
Went crazy trying to make if conditional against repeater sub field. Then became aware I need only repeater field for this, not subfield.