polyfill.js
3 years ago
scripts.js
1 year ago
scripts.js.map
3 years ago
scripts_admin copy.js
4 years ago
scripts_admin.js
1 year ago
scripts_admin_all_pages.js
2 years ago
scripts_es6.js
3 years ago
temp.js
4 years ago
scripts_admin_all_pages.js
24 lines
| 1 | // ------------------------------------ |
| 2 | // DISMISS NOTICES |
| 3 | // ------------------------------------ |
| 4 | |
| 5 | jQuery(document).ready(function($) { |
| 6 | |
| 7 | $('.notice-dismiss,.notice-dismiss-alt', '.wpcf7cf-admin-notice').click(function () { |
| 8 | const $noticeEl = $(this).closest('.wpcf7cf-admin-notice'); |
| 9 | wpcf7cf_dismiss_notice( $noticeEl.data('noticeId'), $noticeEl.data('nonce') ); |
| 10 | }); |
| 11 | |
| 12 | function wpcf7cf_dismiss_notice(noticeId, nonce) { |
| 13 | |
| 14 | if (noticeId === '') { |
| 15 | $('input[name="wpcf7cf_options[notice_dismissed]"]').val('true'); |
| 16 | } |
| 17 | |
| 18 | $.post(ajaxurl, { action:'wpcf7cf_dismiss_notice', noticeId:noticeId, nonce:nonce }, function (response) { |
| 19 | // nothing to do. dismiss_notice option should be set to TRUE server side by now. |
| 20 | }); |
| 21 | |
| 22 | } |
| 23 | |
| 24 | }); |