<?php 
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

?>




<?php if ( $wdpop_image ) { ?>
  <div class="wing--popup-image">
    <?php if ( $wdpop_image_link ) { ?>
      <a href="<?= esc_url( $wdpop_image_link ); ?>" target="<?= esc_attr( $wdpop_image_link_target ); ?>">
    <?php } ?>

    <img src="<?= esc_url( $wdpop_image ); ?>" 
        alt="<?= esc_attr( $popup_name ); ?>" 
        loading="lazy" 
        class="wing-popup--image">

    <?php if ( $wdpop_image_link ) { ?>
      </a>
    <?php } ?>
  </div>
<?php } ?>

<?php if ( $popup_type === 'image_and_content' ) { ?>
  <div class="wing--popup-content-wrap text-center">

    <?php if ( $popup_title ) { ?>
      <h1 class="fs-5 wing--popup-title"><?= $popup_title; ?></h1>
    <?php } ?>

    <?php if ( $popup_content ) { ?>
      <div class="wing--popup-content"><?= do_shortcode($popup_content); ?></div>
    <?php } ?>

    <?php if ( $popup_close ) { ?>
      <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?= $popup_close; ?></button>
    <?php } ?>

    <?php if ( $cta_text ) { ?>
      <a type="button" class="btn btn-primary" href="<?= $cta_url; ?>" target="<?= $cta_target; ?>"><?= $cta_text; ?></a>
    <?php } ?>

  </div>
<?php } ?>



