| 1 |
<?php |
| 2 |
/** |
| 3 |
* Notice template. |
| 4 |
* |
| 5 |
* @var string $notice_key |
| 6 |
* @var string $classes |
| 7 |
* @var array $notice |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
|
| 14 |
?> |
| 15 |
<div id="storeengine-admin-notice-<?php echo esc_attr( $notice['key'] ); ?>" class="<?php echo esc_attr( $classes ); ?>" role="alert"> |
| 16 |
<?php if ( $notice['icon'] ) { ?> |
| 17 |
<span class="storeengine-admin-notice__icon" aria-hidden="true"> |
| 18 |
<?php echo \StoreEngine\Admin\Notices::get_svg_icon( $notice['icon'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Controlled inline SVG built from a static whitelist. ?> |
| 19 |
</span> |
| 20 |
<?php } ?> |
| 21 |
|
| 22 |
<div class="storeengine-admin-notice__body"> |
| 23 |
<?php if ( $notice['title'] ) { ?> |
| 24 |
<h3 class="storeengine-admin-notice__title"><?php echo esc_html( $notice['title'] ); ?></h3> |
| 25 |
<?php } ?> |
| 26 |
<div class="storeengine-admin-notice__content"><?php echo wp_kses_post( $notice['message'] ); ?></div> |
| 27 |
</div> |
| 28 |
|
| 29 |
<?php if ( $notice['has_buttons'] ) { ?> |
| 30 |
<div class="storeengine-admin-notice__actions"> |
| 31 |
<?php if ( $notice['button_text'] && $notice['button_action'] ) { ?> |
| 32 |
<a class="<?php echo esc_attr( $notice['button_class'] ?: 'storeengine-btn storeengine-btn--md storeengine-btn--preset-blue' ); ?>" href="<?php echo esc_url( $notice['button_action'] ); ?>"<?php echo ! empty( $notice['button_target'] ) ? ' target="' . esc_attr( $notice['button_target'] ) . '"' : '' ?>> |
| 33 |
<?php echo esc_html( $notice['button_text'] ); ?> |
| 34 |
</a> |
| 35 |
<?php } ?> |
| 36 |
<?php if ( $notice['dismissible'] ) { ?> |
| 37 |
<button class="storeengine-admin-notice-close notice-dismiss" data-notice="<?php echo esc_attr( $notice['key'] ); ?>" aria-label="<?php esc_attr_e( 'Dismiss this notice', 'storeengine' ); ?>"> |
| 38 |
<?php echo \StoreEngine\Admin\Notices::get_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Controlled inline SVG built from a static whitelist. ?> |
| 39 |
</button> |
| 40 |
<?php } ?> |
| 41 |
</div> |
| 42 |
<?php } ?> |
| 43 |
</div> |
| 44 |
<?php |
| 45 |
|