diff --git a/admin/css/woo-paypal-here-admin.css b/admin/css/woo-paypal-here-admin.css index 9a6ec43..6c857da 100644 --- a/admin/css/woo-paypal-here-admin.css +++ b/admin/css/woo-paypal-here-admin.css @@ -80,4 +80,8 @@ cursor: pointer; color: #C5C5C5; -webkit-font-smoothing: antialiased; +} +.updater-dismissible { + padding-right: 38px; + position: relative; } \ No newline at end of file diff --git a/admin/js/woo-paypal-here-admin.js b/admin/js/woo-paypal-here-admin.js index cdc5eeb..a7b3417 100644 --- a/admin/js/woo-paypal-here-admin.js +++ b/admin/js/woo-paypal-here-admin.js @@ -78,4 +78,21 @@ jQuery(function () { }; jQuery.post(ajaxurl, param); } + jQuery(document).off('click', '#angelleye-updater-notice .notice-dismiss').on('click', '#angelleye-updater-notice .notice-dismiss',function(event) { + var r = confirm("If you do not install the Updater plugin you will not receive automated updates for Angell EYE products going forward!"); + if (r == true) { + var data = { + action : 'angelleye_updater_dismissible_admin_notice' + }; + jQuery.post(ajaxurl, data, function (response) { + var $el = jQuery( '#angelleye-updater-notice' ); + event.preventDefault(); + $el.fadeTo( 100, 0, function() { + $el.slideUp( 100, function() { + $el.remove(); + }); + }); + }); + } + }); }); diff --git a/includes/angelleye-functions.php b/includes/angelleye-functions.php index aa876bc..1d33b50 100644 --- a/includes/angelleye-functions.php +++ b/includes/angelleye-functions.php @@ -78,8 +78,14 @@ function angell_updater_notice() { $message = ' Activate the Angell EYE Updater plugin to get updates for your Angell EYE plugins.'; } } - echo '

' . $message . '

' . "\n"; + echo '

' . $message . '

' . "\n"; } - - add_action('admin_notices', 'angell_updater_notice'); + + function angelleye_updater_dismissible_admin_notice() { + set_transient( 'angelleye_updater_notice_hide', 'yes', MONTH_IN_SECONDS ); + } + if ( false === ( $angelleye_updater_notice_hide = get_transient( 'angelleye_updater_notice_hide' ) ) ) { + add_action('admin_notices', 'angell_updater_notice'); + } + add_action( 'wp_ajax_angelleye_updater_dismissible_admin_notice', 'angelleye_updater_dismissible_admin_notice' ); } \ No newline at end of file