Taxonomy - select_advanced - multiple => true ---- Problems

Support General Taxonomy - select_advanced - multiple => true ---- Problems

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2407
    ClementNClementN
    Participant

    Hello,

    I succeeded to use the select_advanced and js_options - multiple .

    The problem is that it doesn't save multiple options of taxonomy even if the form field is ok and allow me to add multiple options

    I used the code bellow .

    				'id'      => 'event_category',
    				'type'    => 'taxonomy',
                    'options' => array(
    				
    				    // Taxonomy name
    				    'taxonomy' => 'event-categories',
    				    // How to show taxonomy: 'checkbox_list' (default) or 'checkbox_tree', 'select_tree', select_advanced or 'select'. Optional
    				    'type'     => 'select_advanced',
    				
    				    // Additional arguments for get_terms() function. Optional
    				    'query_args'     => array(),
                    ),
                    'js_options' => array('multiple' => true,),
                    'placeholder' => 'Select ...',
                    'columns' => '4',
                    'tab'  => 'general',
    #2412
    Anh TranAnh Tran
    Keymaster

    Hi, the js_options parameter is used for displaying only. To store multiple values of taxonomies, you should add 'multiple' => true to the field's param, as following (I also rewrite the parameters to match new version of Meta Box):

    array(
    	'id'   => 'event_category',
    	'type' => 'taxonomy',
    
    	'taxonomy'    => 'event-categories',
    	'field_type'  => 'select_advanced',
    
    	'query_args'  => array(),
    	'js_options'  => array( 'multiple' => true, ),
    	'multiple'    => true,
    	'placeholder' => 'Select ...',
    	'columns'     => '4',
    	'tab'         => 'general',
    ),
    #2416
    ClementNClementN
    Participant

    Great.. Thank you. It works..

    Best regards,|
    Clement

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Taxonomy - select_advanced - multiple => true ---- Problems’ is closed to new replies.