[wp-hackers] Custom field multiple check boxes

Jason LeVan jason at blueluna.com
Mon Jun 28 13:13:29 UTC 2010


Jasper,

This sounds like something that belongs in the support forums (granted this
would be my first reply to this list, so that may be for others to decide).

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.


-Jason

On Mon, Jun 28, 2010 at 9:05 AM, Jasper Frumau <jasperfrumau at gmail.com>wrote:

> Hi everyone,
>
> 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 @
> http://wordpress.pastebin.com/TAL2C0DX . All custom fields *except* my
> multipl 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
> http://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.
> FYI print_r lines were just added to print some data for testing.
>
> Thanks in advance for any input you guys can give me.
>
> Cheers,
>
> Jasper
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
———————
jason levan
BlueLuna

617.938.3944 x709
www.blueluna.com


More information about the wp-hackers mailing list