pass complex json as shortcode parameter

Maybe there is a better solution, but serialize seems to do the job. Instead of json I could pass json_decoded and then serialized parameters. For example $jsonval = json_decode(‘{“foo”: “bar”}’); $serialized = serialize($jsonval); Shortcode will be something like: [myshortcode parameters=”O:8:”stdClass”:1:{s:8:”foo”;s:3:”bar”;}”] At this point I can handle parameters unserializing them: function myshortcodehandler($atts){ $arrparameters = (array) unserialize($atts[“parameters”]); … Read more

wp-json how to fetch image link?

i already fix this by using this $data = array( ‘:attachment’ => $record[_embedded][‘wp:featuredmedia’][‘0’][source_url] ); thanks for no person answered my question.