PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/admin/hooks.php +4 -0 1.0.61 → 1.0.64 View file →
@@ -76,8 +76,9 @@
76 76
77 77 echo wp_kses_post( $notice );
78 78
79 79 $admin_ajax_url = admin_url('admin-ajax.php');
80 + $nonce = wp_create_nonce( 'timetics_dismiss_wc_notice' );
80 81
81 82 ?>
82 83 <script>
83 84 jQuery(document).ready(function($) {
@@ -83,8 +84,9 @@
83 84 jQuery(document).ready(function($) {
84 85 $('.notice.is-dismissible').on('click', '.notice-dismiss', function() {
85 86 var data = {
86 87 action: 'dismiss_woocommerce_notice',
88 + nonce: '<?php echo esc_js( $nonce ); ?>',
87 89 };
88 90
89 91 $.post('<?php echo esc_url( $admin_ajax_url ); ?>', data, function(response) {
90 92 console.log(response);
@@ -100,8 +102,10 @@
100 102 *
101 103 * @return void
102 104 */
103 105 public function dismiss_woocommerce_notice() {
106 + check_ajax_referer( 'timetics_dismiss_wc_notice', 'nonce' );
107 +
104 108 // Store the notice state in user meta
105 109 update_user_meta( get_current_user_id(), 'timetics_woocommerce_notice_dismissed', true );
106 110
107 111 wp_send_json_success('Notice dismissed successfully.');