Multi-directional array in custom post type?
-
Hi all
I am trying to incorporate some custom attributes to a dish post type I am making. There are some standard custom post data elements that are no problem. However, I’d like to offer, through jQuery, an expandable list of inputs so that admin can add custom callouts – as many as they want.
My form code is looking like this:
<label>Abbreviation (e.g. gf for Gluten Free): </label><input type="text" name="custom_callouts[][abbrev]" size="20" value="<?php esc_attr_e($abbr); ?>" /><br /> <label>Description: </label><input type="text" name="custom_callouts[][desc]" size="100" value="<?php esc_attr_e($desc); ?>" />with the two variables declared within a foreach loop that grabs the custom_callouts data from the database.
When I print the callouts data, I’m getting expected results for ‘desc’ only. Each iteration of ‘custom_callouts’ ends up being an array with ‘desc’ = ‘whatever’. The values are correct, but ‘abbrev’ appears not to be written at all.
Any suggestions much appreciated!
John
The topic ‘Multi-directional array in custom post type?’ is closed to new replies.