{"id":14243923,"date":"2021-03-27T21:11:21","date_gmt":"2021-03-27T21:11:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/code-reference-example-error\/"},"modified":"2021-03-27T21:13:09","modified_gmt":"2021-03-27T21:13:09","slug":"code-reference-example-error","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/code-reference-example-error\/","title":{"rendered":"Code Reference example error"},"content":{"rendered":"<p><strong>Function reference for update_post_meta<\/strong><\/p>\n<p>In the section on Character Escaping, the first example incorrectly double-escapes the JSON on line 2 thus:<\/p>\n<p>$escaped_json = &#8216;{&#8220;key&#8221;:&#8221;value with \\\\&#8221;escaped quotes\\\\&#8221;&#8221;}&#8217;;<\/p>\n<p>It should read:<\/p>\n<p>$escaped_json = &#8216;{&#8220;key&#8221;:&#8221;value with \\&#8221;escaped quotes\\&#8221;&#8221;}&#8217;;<\/p>\n<p>The second example (Workaround) is correct.<\/p>\n","protected":false},"template":"","class_list":["post-14243923","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14243923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14243923\/revisions"}],"predecessor-version":[{"id":14243928,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14243923\/revisions\/14243928"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14243923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}