File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ class WCCT_Ajax {
1111 public function __construct () {
1212 add_action ( 'wp_ajax_wcct_save_settings ' , array ( $ this , 'wcct_save_settings ' ) );
1313 add_action ( 'wp_ajax_activate_happy_addons ' , array ( $ this , 'wcct_install_happy_addons ' ) );
14+
15+ add_action ( 'wp_ajax_wcct_dismissable_notice ' , array ( $ this , 'wcct_dismissable_notice ' ) );
1416 }
1517
1618 /**
@@ -98,4 +100,19 @@ public function wcct_install_happy_addons() {
98100 'message ' => __ ( 'Successfully installed and activate, ' , 'woocommerce-conversion-tracking ' )
99101 ]);
100102 }
103+
104+ /**
105+ * Dismissable notice
106+ *
107+ * @return object
108+ */
109+ public function wcct_dismissable_notice () {
110+ if ( ! current_user_can ( 'manage_options ' ) ) {
111+ return ;
112+ }
113+
114+ update_option ( 'wcct_dismissable_notice ' , 'closed ' );
115+
116+ wp_send_json_success ();
117+ }
101118}
You can’t perform that action at this time.
0 commit comments