You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed with the address field type, if the values are empty, the array keys are still added IF the field type is set to repeatable in the metabox.
This becomes problematical when checking to see if an array is empty or not.
If I'm looping through a repeatable cmb2 metabox that's using an address field for each entry for instance.
Shouldn't the array keys be unset if there's no value in them?
The text was updated successfully, but these errors were encountered:
Sure, tried that, unfortunately the order of the structure of my code is such that the custom snippet I've created (based on this address one), is just one of a number of fields in a group repeatable structure. That repeatable structure is also surrounded by structural html specific to it, that's not within a loop.
The upshot is, I'm checking for empty on the array that holds the custom fields array - so array_filter doesn't work as expected.
Everything works as expected if the custom field isn't set as repeatable - so I've got around it by just replicating as many fields as I may possibly require.
I've noticed with the address field type, if the values are empty, the array keys are still added IF the field type is set to repeatable in the metabox.
This becomes problematical when checking to see if an array is empty or not.
If I'm looping through a repeatable cmb2 metabox that's using an address field for each entry for instance.
Shouldn't the array keys be unset if there's no value in them?
The text was updated successfully, but these errors were encountered: