Title: roryfunction28's Replies | WordPress.org

---

# roryfunction28

  [  ](https://wordpress.org/support/users/roryfunction28/)

 *   [Profile](https://wordpress.org/support/users/roryfunction28/)
 *   [Topics Started](https://wordpress.org/support/users/roryfunction28/topics/)
 *   [Replies Created](https://wordpress.org/support/users/roryfunction28/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/roryfunction28/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/roryfunction28/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/roryfunction28/engagements/)
 *   [Favorites](https://wordpress.org/support/users/roryfunction28/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [before_delete_post not working](https://wordpress.org/support/topic/before_delete_post-not-working/)
 *  Thread Starter [roryfunction28](https://wordpress.org/support/users/roryfunction28/)
 * (@roryfunction28)
 * [7 years ago](https://wordpress.org/support/topic/before_delete_post-not-working/#post-11528599)
 * Hi,
 * Thanks for your response.
 * I was deleting permanently.
 * However, I followed your advice of using wp_die() as my way of checking execution,
   and I actually started getting a response. Thanks very much for that suggestion.
   I used this to debug my issue. Issue turned out to be my side in the end. As 
   I worked my way through it, it turned out to be stupidly simple: it wasn’t accessing
   the json file! It was supposed edit the one I’d set, but it was supposed to iterate
   over another one too, and it wasn’t doing that because… I didn’t tell it to!
 * Wouldn’t have been able to get there without your wp_die() suggestion. I was 
   trying to debug it to find the failure point by writing to console, but yeah,
   as you suggested, the browser wasn’t expecting output. My echo’d console.log 
   didn’t fire until wp_die() was invoked, at which point using the console was 
   redundant.
 * I wasn’t aware of wp_die() before this. This is a far better way for me to test
   and debug, since it prevents the final execution, meaning I don’t have to reset
   the conditions (e.g. creating and deleting posts).
 * Cheers!

Viewing 1 replies (of 1 total)