| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for display a notice in admin |
| 4 |
*/ |
| 5 |
|
| 6 |
defined( 'ABSPATH' ) || exit; |
| 7 |
|
| 8 |
if ( ! isset( $message ) ) { |
| 9 |
return; |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! isset( $type ) ) { |
| 13 |
$type = 'success'; |
| 14 |
} |
| 15 |
|
| 16 |
if ( ! isset( $dismissible ) ) { |
| 17 |
$dismissible = true; |
| 18 |
} |
| 19 |
|
| 20 |
if ( strpos( $type, 'notice-' ) === false ) { |
| 21 |
$type = "notice-{$type}"; |
| 22 |
} |
| 23 |
|
| 24 |
$classes = array( 'lp-notice', 'notice', $type ); |
| 25 |
?> |
| 26 |
|
| 27 |
<div id="<?php echo esc_attr( $id ?? '' ); ?>" class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"> |
| 28 |
<p><?php echo esc_html( $message ); ?></p> |
| 29 |
|
| 30 |
<?php if ( $dismissible ) : ?> |
| 31 |
<button class="notice-dismiss" data-dismiss-notice="<?php echo esc_attr( $id ?? '' ); ?>"></button> |
| 32 |
<?php endif; ?> |
| 33 |
</div> |
| 34 |
|