Timeline for AJAX wp_insert_user WORKS but responds with "The site is not enabled"
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 30, 2021 at 21:33 | vote | accept | James | ||
Jun 29, 2021 at 13:42 | answer | added | James | timeline score: 1 | |
Jun 29, 2021 at 13:04 | comment | added | James | Interestingly I made a test file that just creates a new user, no ajax or anything and it printed the same "This site is not enabled" string. The code also doesn't reach my print statements so I think this function is causing a critial error. | |
Jun 29, 2021 at 10:03 | comment | added | James | @TomJNowell Thank you Tom, I've not heard of network admin before so I will look into this. I used the old admin ajax as I inherited this project from another developer and this particular section didn't work and I couldn't figure out why, so I thought if I rewrote it into a cleaner class I could find the problem but it seems I just spent a lot of time to achieve the same outcome. | |
Jun 28, 2021 at 22:20 | comment | added | Tom J Nowell♦ | Also is there a reason you chose to use the old admin AJAX handler instead of using a modern REST API endpoint? You'll get pretty URLs and human readable error messages | |
Jun 28, 2021 at 22:19 | comment | added | Tom J Nowell♦ |
I would note even in failure it returns using wp_send_json_success , so my guess is that this is coming from the WPDB error message. It's also possible that not all paths through your classes code result in a die or exit statement, and the code outputting this message has nothing to do with this AJAX handler. Perhaps you should check the network admin and verify that the site is activated/enabled?
|
|
Jun 28, 2021 at 21:26 | review | First posts | |||
Jun 29, 2021 at 13:57 | |||||
Jun 28, 2021 at 21:22 | history | asked | James | CC BY-SA 4.0 |