Viewing 2 reply threads
  • Author
    Posts
    • #9556
      thor
      Participant

      I have added ‘reset’ => ‘false’ to the fields, but when hiding and showing the fields (via ‘product_show_faq’) it still clears the very first field ‘product_faq_title’ – not any of the other fields – not even a second (repeated) ‘product_faq_title’. A bug?

      <?php
      /*
      Title: FAQ
      Post Type: product
      Priority: high
      Order: -1
      */
      
      piklist('field', array(
      	'type' => 'radio',
      	'field' => 'product_show_faq',
      	'label' => 'Show FAQ?',
      	'attributes' => array(
      		'class' => 'text',
      	),
      	'choices' => array(
      		'yes' => 'Yes',
      		'no' => 'No'
      	),
      	'value' => 'no'
      ));
      
      piklist('field', array(
      	'type' => 'group',
      	'field' => 'product_faq',
      	'label' => 'FAQ',
      	'list' => false,
      	'reset' => 'false',
      	'conditions' => array(
      		array(
      			'field' => 'product_show_faq',
      			'value' => 'yes'
      		)
      	),
      	'add_more' => true,
      	'fields' => array(
      		array(
      			'type' => 'text',
      			'reset' => 'false',
      			'field' => 'product_faq_title',
      			'required' => false,
      			'columns' => 12,
      			'attributes' => array(
      				'placeholder' => 'Type question'
      			),
      		),
      
      		array(
      			'type' => 'editor',
      			'reset' => 'false',
      			'field' => 'product_faq_content', // 'post_content' is the field name of the WordPress DEFAULT editor
      			'value' => '',
      			//'template' => 'field', // Only display the field not the label
      			'options' => array( // Pass any option that is accepted by wp_editor()
      				'wpautop' => true,
      				'media_buttons' => false,
      				'shortcode_buttons' => false,
      				'teeny' => true,
      				'dfw' => false,
      				'quicktags' => true,
      				'drag_drop_upload' => false,
      				'tinymce' => array(
      					'resize' => false,
      					'wp_autoresize_on' => true,
      					'toolbar1' => 'bold,italic,underline,link,unlink',
      					'toolbar2' => '',
      				)
      			)
      		)
      	)
      ));
      
    • #9557
      Steve
      Keymaster

      yup… looks like you found a bug. The Piklist 2.0 rewrite will correct that.

    • #9558
      thor
      Participant

      Ok – looking forward to piklist 2.0 🙂

Viewing 2 reply threads
  • You must be logged in to reply to this topic.