Tagged: checkbox
- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by
pierre.
-
AuthorPosts
-
-
December 6, 2016 at 11:12 am #7616
pierreParticipantHi,
I tried to create a checkbox list with the French States :
piklist('field', array(
'type' => 'checkbox'
,'field' => 'dept_distributeur'
,'label' => 'Département'
,'choices' => array(
"01" => "01 - Ain"
,"02" => "02 - Aisne"
,"03" => "03 - Allier"
,"04" => "04 - Alpes-de-Haute-Provence"
)
));
But when I check more than 1 checkbox, only one is saved : the highest.
For example, when I check 01, 02 and 04, only 04 is saved on my custom post.What am I doing wrong ?
Thanks. -
December 9, 2016 at 12:52 am #7632
SteveKeymaster@pierre– Welcome to the Piklist community!
Your code works fine for me. A few things:
1) Make sure you haven’t created another field with the same name by accident.
2) You may also want to try this: https://piklist.com/learn/doc/arent-fields-saving/ -
December 9, 2016 at 11:26 am #7637
pierreParticipant@Steve,
I checked these two points and disabled all my other plugins but I still have the same problem.
I don’t know where is the problem. I already made a checkbox list with Piklist for another project and everything works well (same server, same configurations…). I compared all my files with this project and everything seems to be OK.
Some parts of my phpinfo file :
PHP 7.0.13
memory_limit : 256M
post_max_size : 64MAny other idea of what could be the problem ?
Thank you ! -
December 12, 2016 at 9:29 am #7647
pierreParticipantI found my problem origin !
In fact, my theme doesn’t allow multiple checkbox saving in database… But I don’t know why. I’m using Hind (child)theme (https://themeforest.net/item/hind-multiconcept-portfolio-wordpress-theme/12643880).
Do you have an idea of what could be causing this problem ?
For me, this theme is blocking multiple meta_key saving with the same name. Is it possible ?Thanks.
-
December 15, 2016 at 5:43 pm #7659
SteveKeymaster@pierre– Anything is possible with WordPress! 😉
Don’t worry, Piklist has your back. In the Piklist Demos check out COMMON (tab) > LISTS > CHECKBOXES. You want to look at the GROUP LISTS field. It’s setup so your checkbox data will save in ONE field as an array.
Just and FYI, this is one of the reasons people stay away from these all-in-one themes… they do too much and take over your site.
-
December 19, 2016 at 5:32 am #7676
pierreParticipant@Steve,
Indeed, the group list solved my problem. It works well now !Thank you so much for your help 😀
-
-
AuthorPosts
- The topic ‘Impossible to save multiple checkbox’ is closed to new replies.