Tagged: multiselect field, select2 field
- This topic has 3 replies, 2 voices, and was last updated 7 years, 3 months ago by
Steve.
-
AuthorPosts
-
-
October 14, 2014 at 2:32 pm #2567
prasenjitMemberHi,
I am trying to use the multi-select field using the tutorial published here: but it is not working.
Here is my code:
piklist( 'field', array( 'type' => 'select', 'scope' => 'taxonomy', 'field' => 'languages', 'label' => __('Languages'), 'description' => __('Select languages.'), 'columns' => '12', 'choices' => piklist( get_terms( 'language', array( 'hide_empty' => false ) ), array( 'term_id', 'name' ) ), 'attributes' => array( 'multiple' ) ) );Am I doing it wrong? I also tried the user contributed field ‘select2’ from the github repo . Even that isn’t working. Did you guys ever integrate the select2 field?
Thanks.
-
October 15, 2014 at 10:50 am #2570
SteveKeymasterDoes it work in a the built-in Demos? Under the LISTS tab.
-
October 15, 2014 at 9:45 pm #2571
prasenjitMemberYes it does. You need to rectify your tutorial
As given in the tutorial:
'attributes' => array( 'multiple' )and the correct code should be (taken from
field-multiselect.phpunder demos):'attributes' => array( 'multiple' => 'multiple' )Also @Steve is there any plans of integrating Select2 or Chosen fields? If not, then a tutorial about creating new field types would be of great help.
-
October 16, 2014 at 4:00 pm #2572
SteveKeymaster@prasenjit– Documentation has been updated! Thanks for the help.
In regards with Select2 or Chosen, we are going to wait and see what happens in WordPress 4.1. They might be integrating one of those fields.
-
-
AuthorPosts
- You must be logged in to reply to this topic.