WordPress “Save Draft” fails: “the response is not a valid JSON response”
The reason of this error was stupid. The problem was that when wordpress sent a JSON request, the answer was not in JSON format. There was an echo instead of return in one of my theme functions, under template-tags.php. This caused each json to take that html out with it. I replaced echo with return … Read more