scripts.js
5 years ago
scripts.js.map
5 years ago
scripts_admin.js
5 years ago
scripts_admin_all_pages.js
5 years ago
scripts_es6.js
5 years ago
scripts_admin_all_pages.js
25 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 | wpcf7cf_dismiss_notice( |
| 9 | $(this).closest('.wpcf7cf-admin-notice').data('noticeId') |
| 10 | ); |
| 11 | }); |
| 12 | |
| 13 | function wpcf7cf_dismiss_notice(noticeId) { |
| 14 | |
| 15 | if (noticeId === '') { |
| 16 | $('input[name="wpcf7cf_options[notice_dismissed]"]').val('true'); |
| 17 | } |
| 18 | |
| 19 | $.post(ajaxurl, { action:'wpcf7cf_dismiss_notice', noticeId:noticeId }, function(response) { |
| 20 | // nothing to do. dismiss_notice option should be set to TRUE server side by now. |
| 21 | }); |
| 22 | |
| 23 | } |
| 24 | |
| 25 | }); |