{"action":"closed","issue":{"url":"https://api.github.com/repos/Automattic/batcache/issues/33","labels_url":"https://api.github.com/repos/Automattic/batcache/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/batcache/issues/33/comments","events_url":"https://api.github.com/repos/Automattic/batcache/issues/33/events","html_url":"https://github.com/Automattic/batcache/issues/33","id":37232155,"number":33,"title":"Deleted post fails to flush cache","user":{"login":"joehoyle","id":161683,"avatar_url":"https://avatars.githubusercontent.com/u/161683?v=3","gravatar_id":"","url":"https://api.github.com/users/joehoyle","html_url":"https://github.com/joehoyle","followers_url":"https://api.github.com/users/joehoyle/followers","following_url":"https://api.github.com/users/joehoyle/following{/other_user}","gists_url":"https://api.github.com/users/joehoyle/gists{/gist_id}","starred_url":"https://api.github.com/users/joehoyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehoyle/subscriptions","organizations_url":"https://api.github.com/users/joehoyle/orgs","repos_url":"https://api.github.com/users/joehoyle/repos","events_url":"https://api.github.com/users/joehoyle/events{/privacy}","received_events_url":"https://api.github.com/users/joehoyle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/batcache/labels/bug","name":"bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-07-07T00:33:03Z","updated_at":"2015-10-21T12:39:13Z","closed_at":"2015-10-21T12:39:13Z","body":"When a post is deleted, `clean_post_cache` is fired _after_ the post is deleted, this causes the Batcache function `batcache_post` to throw a Notice (as the post doesn't exist) and also fails to clean the cache URL (as the permalink can not be retrieved). My proposed solution would be to hook `batcache_post` into `delete_post` so it can be run _before_ the post is deleted."}}