PluginProbe
WebberZone Top 10 — Popular Posts / 4.4.0
WebberZone Top 10 — Popular Posts v4.4.0
4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 1.6.1 All 117 releases
top-10 / includes / admin / js / admin-notices.js

admin-notices.js in WebberZone Top 10 — Popular Posts 4.4.0, at includes/admin/js/admin-notices.js

26 lines 815 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Admin notice dismissal handler.
3 *
4 * Reads configs pushed into window.adminNoticesConfigs by each plugin instance
5 * via wp_add_inline_script. Each config object contains:
6 * - prefix {string} Plugin prefix (matches data-notice-prefix attribute).
7 * - action {string} AJAX action name.
8 * - nonce {string} Nonce for the AJAX request.
9 */
10 jQuery(document).ready(function ($) {
11 var configs = window.adminNoticesConfigs || [];
12
13 configs.forEach(function (config) {
14 $('.notice[data-notice-prefix="' + config.prefix + '"]').on('click', '.notice-dismiss', function () {
15 var $notice = $(this).closest('.notice');
16
17 $.post(ajaxurl, {
18 action: config.action,
19 notice_id: $notice.data('notice-id'),
20 dismiss_time: $notice.data('dismiss-time'),
21 nonce: config.nonce
22 });
23 });
24 });
25 });
26