Skip to content
Snippets Groups Projects

Feature/notice dismiss link

Merged Krzysztof Dyszczyk requested to merge feature/notice-dismiss-link into master
5 files
+ 23
5
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 7
1
jQuery( document ).on( 'click', '.notice-dismiss', function() {
jQuery( document ).on( 'click', '.notice-dismiss', function() {
var notice_name = jQuery(this).closest('div.notice').data('notice-name');
var notice_name = jQuery(this).closest('div.notice').data('notice-name');
 
var source = jQuery(this).closest('div.notice').data('source');
if ('' !== notice_name) {
if ('' !== notice_name) {
jQuery.ajax({
jQuery.ajax({
url: ajaxurl,
url: ajaxurl,
type: 'post',
type: 'post',
data: {
data: {
action: 'wpdesk_notice_dismiss',
action: 'wpdesk_notice_dismiss',
notice_name: notice_name
notice_name: notice_name,
 
source: source,
},
},
success: function (response) {
success: function (response) {
}
}
@@ -14,3 +16,7 @@ jQuery( document ).on( 'click', '.notice-dismiss', function() {
@@ -14,3 +16,7 @@ jQuery( document ).on( 'click', '.notice-dismiss', function() {
}
}
});
});
 
jQuery( document ).on( 'click', '.notice-dismiss-link', function() {
 
jQuery(this).closest('div.notice').data('source',jQuery(this).data('source'));
 
jQuery(this).closest('div.notice').find('.notice-dismiss').click();
 
});
Loading