Custom Fields
Re-Envisioned
Support General Multiple Selecet field values are not saved

  • Creator
    Topic
  • #5178
    sociality
    Participant

    Hello, I am using a multiple select field under the development version plugin but the values are not being saved. The same for the button select all/none, it does not work.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #5182
    Anh Tran
    Keymaster

    Can you post the code you use? It seems to work for me 🙁

    #5183
    sociality
    Participant

    Yes,

    The strange thing is that it works for posts post type but not for the attachment post type. This is it:

    		$meta_boxes[] = array(
    		'title' => esc_html__( 'Artist Info', 'colours-of-a-journey-plugin' ),
    		'post_types'  => 'attachment',
    		'media_modal' => true,
    		'fields' => array(
    			array(
    				'name'		=> esc_html__( 'Theme tags (select one or more values)', 'colours-of-a-journey-plugin' ),
    				'id'		=> $prefix . 'attachment_theme_tags',
    				'type'		=> 'select',
    				'options'	=> array(
    					'past'		=> esc_html__( 'Past', 'colours-of-a-journey-plugin' ),
    					'present'	=> esc_html__( 'Present', 'colours-of-a-journey-plugin' ),
    					'future'	=> esc_html__( 'Future', 'colours-of-a-journey-plugin' ),
    					'home'		=> esc_html__( 'Home', 'colours-of-a-journey-plugin' ),
    					'nature'	=> esc_html__( 'Nature', 'colours-of-a-journey-plugin' ),
    					'passage'	=> esc_html__( 'Passage', 'colours-of-a-journey-plugin' ),
    					'peace'		=> esc_html__( 'Peace', 'colours-of-a-journey-plugin' ),
    				),
    				'multiple'			=> true,
    				'select_all_none'	=> true,
    			),
    		),
    	);
    
    #5189
    Anh Tran
    Keymaster

    Ah, I got it. Unfortunately, this is the limitation of the plugin when working in the modal mode. WordPress limits how fields are outputted and saved. We also can’t enqueue JavaScript for it as well. So, please just use the simple fields there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.