← Back
Editing: widget-overlay.php
<?php /** * Centered overlay card above an inert teaser. * * @since 4.10.0 * * @var string $title Overlay heading. * @var string $text Overlay body copy. * @var array $cta Button: label, url, style, target_blank, arrow. * @var string $teaser Teaser template name under `templates/dashboard/teasers/`. * Empty renders the overlay on its own. */ if ( ! defined( 'ABSPATH' ) ) { exit; } $btn_color = ( isset( $cta['style'] ) && $cta['style'] === 'secondary' ) ? 'wp-mail-smtp-btn-grey' : 'wp-mail-smtp-btn-orange'; $show_arrow = ! empty( $cta['arrow'] ); ?> <div class="wpms-dashboard-overlay-container"> <?php if ( $teaser !== '' ) : ?> <div class="wpms-dashboard-teaser" aria-hidden="true" inert> <?php wp_mail_smtp_render( 'dashboard/teasers/' . $teaser ); ?> </div> <?php endif; ?> <div class="wpms-dashboard-overlay"> <h3 class="wpms-dashboard-overlay__title"><?php echo esc_html( $title ); ?></h3> <p class="wpms-dashboard-overlay__text"><?php echo esc_html( $text ); ?></p> <a href="<?php echo esc_url( $cta['url'] ); ?>" class="wp-mail-smtp-btn wp-mail-smtp-btn-md <?php echo esc_attr( $btn_color ); ?>" <?php echo empty( $cta['target_blank'] ) ? '' : 'target="_blank" rel="noopener noreferrer"'; ?>> <?php echo esc_html( $cta['label'] ); ?> <?php if ( $show_arrow ) : ?> <i class="wpms:icon-[fa6-solid--arrow-right] wpms:w-[12px] wpms:h-[12px]" aria-hidden="true"></i> <?php endif; ?> </a> <?php if ( $teaser !== '' ) : ?> <p class="wpms-dashboard-overlay__disclaimer"> <?php echo esc_html__( 'The data shown behind this popup is for example purposes only. No email data has been recorded.', 'wp-mail-smtp' ); ?> </p> <?php endif; ?> </div> </div>
Save File
Cancel