-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
Plugin Name: I Recommend This | ||
Plugin URI: https://themeist.com/plugins/wordpress/i-recommend-this/#utm_source=wp-plugin&utm_medium=i-recommend-this&utm_campaign=plugins-page | ||
Description: This plugin allows your visitors to recommend or like your posts. | ||
Version: 3.9.0 | ||
Version: 3.9.1 | ||
Author: Harish Chouhan, Themeist | ||
Author URI: https://themeist.com/ | ||
Author Email: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
jQuery(document).ready(function($) { | ||
$(document).on('click', '.dot-irecommendthis', function() { | ||
var link = $(this); | ||
var unrecommend = link.hasClass('active'); | ||
var id = $(this).attr('id'); | ||
var suffix = link.find('.dot-irecommendthis-suffix').text(); | ||
|
||
// Generate a nonce | ||
var nonce = dot_irecommendthis.nonce; | ||
$(document).on('click', '.dot-irecommendthis', function(event) { | ||
event.preventDefault(); | ||
|
||
$.post(dot_irecommendthis.ajaxurl, { | ||
action: 'dot-irecommendthis', | ||
recommend_id: id, | ||
suffix: suffix, | ||
unrecommend: unrecommend, | ||
security: nonce, // Pass the nonce as part of the request | ||
}, function(data) { | ||
let title = unrecommend ? "Recommend this" : "You already recommended this"; | ||
link.html(data).toggleClass('active').attr('title', title); | ||
}); | ||
var link = $(this); | ||
var unrecommend = link.hasClass('active'); | ||
var id = link.attr('id'); | ||
var suffix = link.find('.dot-irecommendthis-suffix').text(); | ||
|
||
// Generate a nonce | ||
var nonce = dot_irecommendthis.nonce; | ||
|
||
return false; | ||
}); | ||
$.post(dot_irecommendthis.ajaxurl, { | ||
action: 'dot-irecommendthis', | ||
recommend_id: id, | ||
suffix: suffix, | ||
unrecommend: unrecommend, | ||
security: nonce // Pass the nonce as part of the request | ||
}, function(data) { | ||
var title = unrecommend ? "Recommend this" : "You already recommended this"; | ||
link.html(data).toggleClass('active').attr('title', title); | ||
}).fail(function(xhr, status, error) { | ||
console.error("Error: " + error); | ||
}); | ||
|
||
return false; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters