frontend.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. $has_lightbox = vamtam_sanitize_bool( $settings->lightbox_embed );
  3. $button_attrs = '';
  4. if ( $has_lightbox ) {
  5. global $wp_embed, $content_width;
  6. $lightbox_content = do_shortcode( $wp_embed->run_shortcode( '[embed width="' . esc_attr( $content_width ) . '"]' . $settings->link . '[/embed]' ) );
  7. $button_attrs .= ' data-vamtam-lightbox="' . esc_attr( $lightbox_content ) . '"';
  8. $settings->link_target = '_blank';
  9. Vamtam_Elements_B::enqueue_lightbox_template();
  10. }
  11. ?>
  12. <?php if ( ! isset( $settings->exclude_wrapper ) ) : ?>
  13. <span class="fl-icon-wrap">
  14. <?php endif; ?>
  15. <span class="fl-icon">
  16. <?php if ( ! empty( $settings->link ) ) : ?>
  17. <a href="<?php echo esc_url( $settings->link ) ?>" target="<?php echo esc_attr( $settings->link_target ) ?>" <?php echo $button_attrs // xss ok ?>>
  18. <?php endif; ?>
  19. <i class="<?php echo esc_attr( $settings->icon ) ?> <?php if ( $settings->bg_color ) echo 'has-background' ?>"></i>
  20. <?php if ( ! empty( $settings->link ) ) : ?></a><?php endif; ?>
  21. </span>
  22. <?php if ( ! empty( $settings->text ) ) : ?>
  23. <span class="fl-icon-text">
  24. <?php if ( ! empty( $settings->link ) ) : ?>
  25. <a href="<?php echo esc_url( $settings->link ) ?>" target="<?php echo esc_attr( $settings->link_target ) ?>" <?php echo $button_attrs // xss ok ?>>
  26. <?php endif; ?>
  27. <?php echo strip_tags( $settings->text, '<span><bold><b><i><em><br>' ); // xss ok ?>
  28. <?php if ( ! empty( $settings->link ) ) : ?></a><?php endif; ?>
  29. </span>
  30. <?php endif; ?>
  31. <?php if ( ! isset( $settings->exclude_wrapper ) ) : ?>
  32. </span>
  33. <?php endif; ?>