json – wordpress rest api escape returned url forward slash

it’s no different since & is displayed in raw HTML &, This is the standard JSON encodingand is solved by decoding JSON. Any application that is unable to handle this has probably forgotten to parse the JSON response.

For example:

const url = JSON.parse( '"https:\/\/s.w.org\/plugins\/geopattern-icon\/action-scheduler.svg"' );
console.log( url );

Will print the URL as you expect. The JSON decode then grabs that value from the resulting array/object.

Leave a Comment