Tagged: , ,

Viewing 1 reply thread
  • Author
    Posts
    • #7288

      Hello guys, i’m having a strange issue, when i want to save a widget, it reset all my fields and is not saving nothing!

      here is my code and a gift showing error

      promotions-form.php

      <?php
      
       piklist('field', array(
          'type' => 'group'
          ,'field' => 'lt_box_promotions'
          ,'add_more' => true
          ,'fields' => array(
            array(
              'type' => 'file'
              ,'field' => 'lt_box_image'
              ,'columns' => 12
              ,'label' => __('Agregar imagen','piklist')
              ,'description' => __('Seleccione la imagen que desea mostrar en la promoción','piklist')
              ,'options' => array(
                  'basic' => false
                  ,'multiple' => false
              )
            )
             ,array(
              'type' => 'text'
              ,'field' => 'lt_box_link'
              ,'columns' => 12
              ,'attributes' => array(
                'placeholder' => 'Enlace (link)'
              )
            )
            ,array(
              'type' => 'radio'
              ,'field' => 'tc_box_open'
              ,'columns' => 12
              ,'label' => __('¿Abre en otra pestaña?','piklist')
      	    ,'choices' => array(
      	      0 => 'No',
      	      1 => 'Si'
      	    )
            )
          )
        ));

      promotions.php

      <?php
      /*
      Title: Hot Topix: Promotions
      Description: Widget para añadir promociones
      */
      ?>
      
      <?php echo $before_widget; ?>
       
      
      <ul class="bxslider">
      	<?php foreach($settings['lt_box_promotions'] as $slide){ ?>
      		<?php $image = wp_get_attachment_image_src(
      					$slide['lt_box_image'][0],
      					'medium', //size full,medium,thumbnail
      					false //icon
      			  ); ?>
      		<li>
      			<?php 
      				if($slide['lt_box_link'] != ""){ 
      					//verificar si abre en otra pestaña
      					$openInBlankPage = $slide['tc_box_open'][0];
      			?>
      				<a href="<?= $slide['lt_box_link'] ?>"
      				  <?php if($openInBlankPage == 1){ echo 'target="_blank"'; } ?>
      				>
      					<img src="<?= $image[0] ?>" />
      				</a>
      			<?php }else{?>
      				<img src="<?= $image[0] ?>" />
      			<?php }?>
      		</li>
      	<?php } ?>
      </ul>
      
       
      <?php echo $after_widget; ?>
      Attachments:
      You must be logged in to view attached files.
    • #7306
      Steve
      Keymaster

      Try removing the field ‘lt_box_promotions’

Viewing 1 reply thread
  • You must be logged in to reply to this topic.