[wp-trac] [WordPress Trac] #40718: MCE editor_settings first_init 'format' JSON names should be quoted
WordPress Trac
noreply at wordpress.org
Tue Sep 5 12:13:25 UTC 2017
#40718: MCE editor_settings first_init 'format' JSON names should be quoted
-------------------------+-----------------------------
Reporter: MrGregWaugh | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone: Future Release
Component: Editor | Version:
Severity: normal | Resolution: worksforme
Keywords: has-patch | Focuses:
-------------------------+-----------------------------
Changes (by parsmizban):
* status: new => closed
* resolution: => worksforme
Comment:
Use this decoder for such json arrays:
[https://github.com/parsmizban/services-json]
{{{
// create a new instance of Services_JSON
$json = new Services_JSON();
// convert a complexe value to JSON notation, and send it to the browser
$value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
$output = $json->encode($value);
print($output);
// prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
// accept incoming POST data, assumed to be in JSON notation
$input = file_get_contents('php://input', 1000000);
$value = $json->decode($input);
// if you want to convert json to php arrays:
$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40718#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list