| @@ -1,5 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | + | |
| 2 | 6 | /** |
| 3 | 7 | * Admin notices class |
| 4 | 8 | * |
| 5 | 9 | * @package Wa_Notifier |
| @@ -26,8 +30,11 @@ | ||
| 26 | 30 | /** |
| 27 | 31 | * Init |
| 28 | 32 | */ |
| 29 | 33 | public static function init() { |
| 34 | + if(!is_admin()){ | |
| 35 | + return; | |
| 36 | + } | |
| 30 | 37 | $user_id = get_current_user_id(); |
| 31 | 38 | $transient_notices = get_transient( 'notifier_notice_' . $user_id ); |
| 32 | 39 | if ( isset($transient_notices) ) { |
| 33 | 40 | add_action('admin_notices', array( __CLASS__, 'show_transient_notices')); |