Created
January 31, 2014 18:42
-
-
Save leobaiano/8739582 to your computer and use it in GitHub Desktop.
Enviar notificação quando o post receber comentários no form de comments do facebook (WordPress)
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
jQuery(function($) { | |
$.data(document.body, 'ajaxUrl', '<?php echo admin_url('admin-ajax.php'); ?>'); | |
FB.init({ | |
appId : '1419904448233697', | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
xfbml : true // parse XFBML | |
}); | |
FB.Event.subscribe('comment.create', | |
function(response) { | |
var post_url = response.href; | |
$.get($.data(document.body, 'ajaxUrl' ), { | |
action: 'facebook_comment_post', | |
post_url: post_url | |
}, | |
function(data){ | |
}, | |
"json" | |
); | |
} | |
); | |
FB.Event.subscribe('comment.remove', | |
function (response) { | |
var post_url = response.href; | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment