In Wordpress can I store a JSON object as a post and retrieve as it through REST?

403 views Asked by At

Is it possible in WP to paste in a post a JSON object such as

[
  {
    name: 'hello',
    type: 'myself',
  },
]

and retrieve it exactly like this?

The maximum I've been able to do is to add this in a code block and then I will get

\n<pre class=\"wp-block-code\"><code> [{\"name\":\"hello\",\"type\":\"myself\",
1

There are 1 answers

0
GWorking On

Obviously if the string is obtained through a variable with content="...", everything there has to have the " escaped, so I don't delete the question but it was a nonsense question