{"action":"created","issue":{"url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/121","labels_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/121/comments","events_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/121/events","html_url":"https://github.com/inpsyde/multilingual-press/issues/121","id":89232666,"number":121,"title":"Do not redirect while DOING_AJAX","user":{"login":"dboune","id":68863,"avatar_url":"https://avatars.githubusercontent.com/u/68863?v=3","gravatar_id":"","url":"https://api.github.com/users/dboune","html_url":"https://github.com/dboune","followers_url":"https://api.github.com/users/dboune/followers","following_url":"https://api.github.com/users/dboune/following{/other_user}","gists_url":"https://api.github.com/users/dboune/gists{/gist_id}","starred_url":"https://api.github.com/users/dboune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dboune/subscriptions","organizations_url":"https://api.github.com/users/dboune/orgs","repos_url":"https://api.github.com/users/dboune/repos","events_url":"https://api.github.com/users/dboune/events{/privacy}","received_events_url":"https://api.github.com/users/dboune/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/inpsyde/multilingual-press/labels/feature","name":"feature","color":"009800"},{"url":"https://api.github.com/repos/inpsyde/multilingual-press/labels/needs%20testing","name":"needs testing","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"tfrommen","id":6049306,"avatar_url":"https://avatars.githubusercontent.com/u/6049306?v=3","gravatar_id":"","url":"https://api.github.com/users/tfrommen","html_url":"https://github.com/tfrommen","followers_url":"https://api.github.com/users/tfrommen/followers","following_url":"https://api.github.com/users/tfrommen/following{/other_user}","gists_url":"https://api.github.com/users/tfrommen/gists{/gist_id}","starred_url":"https://api.github.com/users/tfrommen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfrommen/subscriptions","organizations_url":"https://api.github.com/users/tfrommen/orgs","repos_url":"https://api.github.com/users/tfrommen/repos","events_url":"https://api.github.com/users/tfrommen/events{/privacy}","received_events_url":"https://api.github.com/users/tfrommen/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inpsyde/multilingual-press/milestones/6","html_url":"https://github.com/inpsyde/multilingual-press/milestones/2.2.0","labels_url":"https://api.github.com/repos/inpsyde/multilingual-press/milestones/6/labels","id":1007340,"number":6,"title":"2.2.0","description":null,"creator":{"login":"toscho","id":135009,"avatar_url":"https://avatars.githubusercontent.com/u/135009?v=3","gravatar_id":"","url":"https://api.github.com/users/toscho","html_url":"https://github.com/toscho","followers_url":"https://api.github.com/users/toscho/followers","following_url":"https://api.github.com/users/toscho/following{/other_user}","gists_url":"https://api.github.com/users/toscho/gists{/gist_id}","starred_url":"https://api.github.com/users/toscho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toscho/subscriptions","organizations_url":"https://api.github.com/users/toscho/orgs","repos_url":"https://api.github.com/users/toscho/repos","events_url":"https://api.github.com/users/toscho/events{/privacy}","received_events_url":"https://api.github.com/users/toscho/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":11,"state":"open","created_at":"2015-03-05T11:13:56Z","updated_at":"2015-06-19T15:17:26Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-06-18T08:29:56Z","updated_at":"2015-06-19T19:24:17Z","closed_at":null,"body":"I found it necessary in one circumstance to hook `mlp_redirect_url` and prevent redirects during an XHR.\r\n\r\nSpecifically this occurs with plugins that do not use `wp-admin/admin-ajax.php` to provide data to the front end. The case here was the use of the Infinite Scroll plugin, part of Jetpack.\r\n\r\nYou can see the code I am referring to here:\r\nhttps://github.com/Automattic/jetpack/blob/3.5.3/modules/infinite-scroll/infinity.php#L596-L614\r\n\r\nIn any case, I believe the definitive determination of whether or not we are in an ajax call should be when `DOING_AJAX` is `true`, not `is_admin()`. It's possible to handle XHR outside of `wp-admin/admin-ajax.php`, and at the very least DOING_AJAX should be set if you care for other code to be able cope with it."},"comment":{"url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/comments/113613431","html_url":"https://github.com/inpsyde/multilingual-press/issues/121#issuecomment-113613431","issue_url":"https://api.github.com/repos/inpsyde/multilingual-press/issues/121","id":113613431,"user":{"login":"dboune","id":68863,"avatar_url":"https://avatars.githubusercontent.com/u/68863?v=3","gravatar_id":"","url":"https://api.github.com/users/dboune","html_url":"https://github.com/dboune","followers_url":"https://api.github.com/users/dboune/followers","following_url":"https://api.github.com/users/dboune/following{/other_user}","gists_url":"https://api.github.com/users/dboune/gists{/gist_id}","starred_url":"https://api.github.com/users/dboune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dboune/subscriptions","organizations_url":"https://api.github.com/users/dboune/orgs","repos_url":"https://api.github.com/users/dboune/repos","events_url":"https://api.github.com/users/dboune/events{/privacy}","received_events_url":"https://api.github.com/users/dboune/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T19:24:17Z","updated_at":"2015-06-19T19:24:17Z","body":"Tested and working!"}}