{"action":"created","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2381","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2381/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2381/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2381/events","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/pull/2381","id":35901359,"number":2381,"title":"Global ajax functions","user":{"login":"somewebmedia","id":2186159,"avatar_url":"https://avatars.githubusercontent.com/u/2186159?v=3","gravatar_id":"","url":"https://api.github.com/users/somewebmedia","html_url":"https://github.com/somewebmedia","followers_url":"https://api.github.com/users/somewebmedia/followers","following_url":"https://api.github.com/users/somewebmedia/following{/other_user}","gists_url":"https://api.github.com/users/somewebmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/somewebmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/somewebmedia/subscriptions","organizations_url":"https://api.github.com/users/somewebmedia/orgs","repos_url":"https://api.github.com/users/somewebmedia/repos","events_url":"https://api.github.com/users/somewebmedia/events{/privacy}","received_events_url":"https://api.github.com/users/somewebmedia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Enhancement","name":"Enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Needs%20Dev%20Feedback","name":"Needs Dev Feedback","color":"ededed"},{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Needs%20Lead%20Dev%20Feedback","name":"Needs Lead Dev Feedback","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-06-17T15:33:30Z","updated_at":"2015-09-03T21:39:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/pulls/2381","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/pull/2381","diff_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/pull/2381.diff","patch_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/pull/2381.patch"},"body":"Created one global function edd_ajax() that receives data from all other\r\nfunctions and delivers the request. Each ajax call has it's own function\r\n(edd_add_to_cart, edd_remove_from_cart, edd_update_quantity...), and\r\naccepts it's properties, than calls edd_ajax(). Each of them accepts two\r\nextra parameters, success and fail. They are the ajax callback functions\r\nand are optional.\r\n\r\nThis way developers can use those functions without the need to know or\r\nwrite their own ajax requests, so they can manipulate HTML on callback\r\nin their own way. Default EDD button events and callbacks stayed the\r\nsame, but also go through the new functions.\r\n\r\n<strong>!important this should be more properly tested!</strong>"},"comment":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/comments/137581702","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/pull/2381#issuecomment-137581702","issue_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2381","id":137581702,"user":{"login":"spencerfinnell","id":491124,"avatar_url":"https://avatars.githubusercontent.com/u/491124?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerfinnell","html_url":"https://github.com/spencerfinnell","followers_url":"https://api.github.com/users/spencerfinnell/followers","following_url":"https://api.github.com/users/spencerfinnell/following{/other_user}","gists_url":"https://api.github.com/users/spencerfinnell/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerfinnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerfinnell/subscriptions","organizations_url":"https://api.github.com/users/spencerfinnell/orgs","repos_url":"https://api.github.com/users/spencerfinnell/repos","events_url":"https://api.github.com/users/spencerfinnell/events{/privacy}","received_events_url":"https://api.github.com/users/spencerfinnell/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T21:39:38Z","updated_at":"2015-09-03T21:39:38Z","body":"Any advantage to this over using `wp.ajax.post`or `wp.ajax.send`, which accepts success/error callbacks, and a few more options?\r\n\r\nhttps://github.com/WordPress/WordPress/blob/master/wp-includes/js/wp-util.js#L72"}}