renventura / wp-delete-user-accounts

Allow your WordPress users to manually delete their own accounts.
GNU General Public License v2.0
13 stars 6 forks source link

Fixed problem with wp_logout returning HTML #5

Closed morgenhaar closed 5 years ago

morgenhaar commented 5 years ago

The wp_logout-function returned html, so the "Success" or "Error"-prompt wouldn't show up Also added a "General Error"-prompt to ajax-function

renventura commented 5 years ago

Thanks for the contribution, @morgenhaar!

Were you able to see what HTML the wp_logout() function was returning. That function doesn't actually return a value, so I'd be curious to know a bit more about what was going on there.

Also, is there a particular reason for changing the AJAX from $.post() to $.ajax()?

morgenhaar commented 5 years ago

@renventura

The wp_logout() would navigate the user back to the front page, which meant that it ended up returning the entire front page as HTML and thereby never getting to the deleting-part of the script

$.ajax() is just straight up easier to debug πŸ˜„

renventura commented 5 years ago

Works for me! Thanks for your work, @morgenhaar. 😁

morgenhaar commented 5 years ago

Thank you for the plugin! ☺️