- This topic has 5 replies, 2 voices, and was last updated 1 month, 1 week ago by .
in PHP it's so hard to setup an multi associated array with dynamically, different conditions.
So it would be great if in Meta Box a NULL Value could be interpreted as unvalid option / field, so we could the short if version (see $slider_activated below):
'fields' => [ [ 'name' => 'Art der Bilddarstellung', 'id' => 'imagepool_type', 'type' => 'radio', 'options' => [ 'global' => 'Wie globale Einstellung', 'single' => 'Ein Einzelbild', 'multiple' => 'Bildreihe', 'slider' => $slider_activated ? 'Überblendung / Karussell' : NULL, ], 'std' => 'global', ],
So if $slider_activated is false, the NULL value would prevent that Meta Box creats this 'slider' option here. If someone likes an empty label, he could still use an empty string '' for this purpose.
Unfortunately, currently with this NULL value we have just an radio option with an empty label.
I'm curious what you guys think about it.
- You must be logged in to reply to this topic.