| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin notices. |
| 4 |
* |
| 5 |
* @package Mailchimp |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Mailchimp\WordPress\Includes\Admin; |
| 9 |
|
| 10 |
/** |
| 11 |
* Display success admin notice. |
| 12 |
* |
| 13 |
* NOTE: WordPress localization i18n functionality should be done |
| 14 |
* on string literals outside of this function in order to work |
| 15 |
* correctly. |
| 16 |
* |
| 17 |
* For more info read here: https://salferrarello.com/why-__-needs-a-hardcoded-string-in-wordpress/ |
| 18 |
* |
| 19 |
* @since 1.7.0 |
| 20 |
* @param string $msg The message to display. |
| 21 |
* @return void |
| 22 |
*/ |
| 23 |
function admin_notice_success( string $msg ) { |
| 24 |
?> |
| 25 |
<div class="notice notice-success is-dismissible"> |
| 26 |
<p> |
| 27 |
<?php |
| 28 |
echo wp_kses( |
| 29 |
$msg, |
| 30 |
array( |
| 31 |
'a' => array( |
| 32 |
'href' => array(), |
| 33 |
'title' => array(), |
| 34 |
'target' => array(), |
| 35 |
), |
| 36 |
'strong' => array(), |
| 37 |
'em' => array(), |
| 38 |
'br' => array(), |
| 39 |
) |
| 40 |
); |
| 41 |
?> |
| 42 |
</p> |
| 43 |
</div> |
| 44 |
<?php |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Display error admin notice. |
| 49 |
* |
| 50 |
* NOTE: WordPress localization i18n functionality should be done |
| 51 |
* on string literals outside of this function in order to work |
| 52 |
* correctly. |
| 53 |
* |
| 54 |
* For more info read here: https://salferrarello.com/why-__-needs-a-hardcoded-string-in-wordpress/ |
| 55 |
* |
| 56 |
* @since 1.7.0 |
| 57 |
* @param string $msg The message to display. |
| 58 |
* @return void |
| 59 |
*/ |
| 60 |
function admin_notice_error( string $msg ) { |
| 61 |
?> |
| 62 |
<div class="notice notice-error"> |
| 63 |
<p> |
| 64 |
<?php |
| 65 |
echo wp_kses( |
| 66 |
$msg, |
| 67 |
array( |
| 68 |
'a' => array( |
| 69 |
'href' => array(), |
| 70 |
'title' => array(), |
| 71 |
'target' => array(), |
| 72 |
), |
| 73 |
'strong' => array(), |
| 74 |
'em' => array(), |
| 75 |
) |
| 76 |
); |
| 77 |
?> |
| 78 |
</p> |
| 79 |
</div> |
| 80 |
<?php |
| 81 |
} |
| 82 |
|