Custom field multiple checkboxes
-
I am working on several custom fields based and a custom type post based
upon information from two sources which I indicated in the code @
https://wordpress.pastebin.com/TAL2C0DX . All custom fields *except* my
multiple checkboxes field – line 163 – 172 – are properly stored in the
database and returned in the Dashboard. Does anyone know how I can remedy
this? I have been added if for a long time now and am pretty much stuck.
One
checkbox based on
https://sltaylor.co.uk/blog/control-your-own-wordpress-custom-fields/ code
works well, but my code two check several options to be stored does not.Jason @ WP Hacks mentioned this
I may have missed something looking at your code, however the problem looks
like the value you are using for your name attribute on the checkboxes.
To store multiple values, your name has to be in the format of
name=”checkboxname[]” – the empty brackets let the processing script know
that it is
to accept an array of values, and not just an true/false value.So, try putting a set of square brackets after the name of your checkbox
field and I’d assume you’ll be good to go.I do not yet understand this yet unfortunately. maybe some extra feedback from the support people here will help.
Thanks in advance for any input you guys can give me.
- The topic ‘Custom field multiple checkboxes’ is closed to new replies.