radio.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * radio
  4. */
  5. if ( isset( $target ) ) {
  6. if ( isset( $options ) ) {
  7. $options = $options + VamtamConfigGenerator::get_select_target_config( $target );
  8. } else {
  9. $options = VamtamConfigGenerator::get_select_target_config( $target );
  10. }
  11. }
  12. $checked = vamtam_get_option( $id, $default );
  13. $ff = empty( $field_filter ) ? '' : 'data-field-filter="' . esc_attr( $field_filter ) . '"';
  14. ?>
  15. <div class="vamtam-config-row radio clearfix <?php echo esc_attr( $class ) ?>" <?php echo $ff // xss ok ?>>
  16. <div class="rtitle">
  17. <h4><label for="<?php echo esc_attr( $id ) ?>"><?php echo esc_html( $name ) ?></label></h4>
  18. <?php vamtam_description( $id, $desc ) ?>
  19. </div>
  20. <div class="rcontent">
  21. <?php foreach ( $options as $key => $option ) : ?>
  22. <label class="toggle-radio">
  23. <input type="radio" name="<?php echo esc_attr( $id ) ?>" value="<?php echo esc_attr( $key ) ?>" <?php checked( $checked, $key ) ?>/>
  24. <span><?php echo esc_html( $option ) ?></span>
  25. </label>
  26. <?php endforeach ?>
  27. </div>
  28. </div>