Skip to content

Instantly share code, notes, and snippets.

@kylephillips
Created June 13, 2017 15:59
Show Gist options
  • Save kylephillips/9c9c17d4c43f8e58dd4b1248a6c5df34 to your computer and use it in GitHub Desktop.
Save kylephillips/9c9c17d4c43f8e58dd4b1248a6c5df34 to your computer and use it in GitHub Desktop.
Using the "Updated Single" event in Favorites
/**
* favorites-updated-single
* Fires after a favorite button has been submitted successfully
* @param favorites - Array of post objects the user has favorited
* @param post_id - The post ID that was updated
* @param site_id - The site ID for the post that was updated (for multisite)
* @param status - Whether the button was active or inactive
*/
$(document).on('favorites-updated-single', function(event, favorites, post_id, site_id, status){
// Do stuff here as needed.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment