{"action":"created","issue":{"url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/489","labels_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/489/comments","events_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/489/events","html_url":"https://github.com/boonebgorges/buddypress-docs/issues/489","id":108916921,"number":489,"title":"Improve redirect after delete","user":{"login":"dcavins","id":1391994,"avatar_url":"https://avatars.githubusercontent.com/u/1391994?v=3","gravatar_id":"","url":"https://api.github.com/users/dcavins","html_url":"https://github.com/dcavins","followers_url":"https://api.github.com/users/dcavins/followers","following_url":"https://api.github.com/users/dcavins/following{/other_user}","gists_url":"https://api.github.com/users/dcavins/gists{/gist_id}","starred_url":"https://api.github.com/users/dcavins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcavins/subscriptions","organizations_url":"https://api.github.com/users/dcavins/orgs","repos_url":"https://api.github.com/users/dcavins/repos","events_url":"https://api.github.com/users/dcavins/events{/privacy}","received_events_url":"https://api.github.com/users/dcavins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-29T17:22:42Z","updated_at":"2015-12-02T16:23:01Z","closed_at":null,"body":"After deleting a document, the user is dropped to the main docs directory. It would be better if they dropped back to the most recent docs directory they were viewing (user library, a group library).\r\n\r\nOne ugh-inducing way to do this would be to create a session cookie that stores the last docs library viewed. (Would love to find a more clever way to do it.)"},"comment":{"url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/comments/161352764","html_url":"https://github.com/boonebgorges/buddypress-docs/issues/489#issuecomment-161352764","issue_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/489","id":161352764,"user":{"login":"dcavins","id":1391994,"avatar_url":"https://avatars.githubusercontent.com/u/1391994?v=3","gravatar_id":"","url":"https://api.github.com/users/dcavins","html_url":"https://github.com/dcavins","followers_url":"https://api.github.com/users/dcavins/followers","following_url":"https://api.github.com/users/dcavins/following{/other_user}","gists_url":"https://api.github.com/users/dcavins/gists{/gist_id}","starred_url":"https://api.github.com/users/dcavins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcavins/subscriptions","organizations_url":"https://api.github.com/users/dcavins/orgs","repos_url":"https://api.github.com/users/dcavins/repos","events_url":"https://api.github.com/users/dcavins/events{/privacy}","received_events_url":"https://api.github.com/users/dcavins/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T16:23:01Z","updated_at":"2015-12-02T16:23:01Z","body":"Hi Boone-\r\n\r\nPlease have a look at this change set: https://github.com/dcavins/buddypress-docs/commit/1ab18f1c9e365e5d2211dfb021e50ff93063d885\r\n\r\nThe patch creates/updates a session cookie tracking the most recently visited docs directory and uses that value for the post-delete redirect. We were using `bp_core_redirect`, which uses `wp_safe_redirect()` internally, so I left that in place.\r\n\r\nThe cookie setting part could be made more sophisticated and check for an existing, matching cookie value before resetting the value of the cookie, if you think there'd be a performance advantage.\r\n\r\nThanks!"}}