• I’ve been learning the WordPress json API for the past few days, and I’ve gotten comfortable with sending requests (get, post, patch). I’ve so far only tried it on my localhost testing site.

    Anyway, I’ve run into some trouble when I sent a patch request, to alter the content of a page. I wanted to do something simple, so I tried to change it to <p id="first">First paragraph.</p> the problem is, when that is done, it escapes the html attribute into <p id=\\\"first\\\">

    I’ve tried every possible combination I could think of, with both single and double quotes, but it always escapes it. In the page’s source code, it reads as <p id=\"first\">Test</p>.

    I’ve tried with Python, as well as cURL on my computer’s terminal, with both giving the same results, so I know it is originating with WordPress. I’m sure everything is being escaped to prevent malicious or poor code from breaking things, but is there some way for me to still use my html code in the content of my pages? It allowed me to create the page with a post request, but if I try to edit anything, my html gets escaped.

    https://wordpress.org/plugins/json-rest-api/

  • The topic ‘Editing Page Content Through API Escapes HTML Tags/Attributes’ is closed to new replies.