Example
Debug Info:DEBUG: wp_remote_get to http://sulistrowiczki.sobotka.pl/wp-content/plugins/json-content-importer/json/gutenbergblockexample1.json
DEBUG: arguments: Array ( [timeout] => 5 )
DEBUG: success getting URL
If you want to use the WP-Shortcode: CopyPaste this Shortcode in the Shortcode-Block or the WordPress-TEXT-editor!
API answer:
Inspect JSON: Copypaste (click in box, Strg-A marks all, then insert into clipboard) the JSON from the following box to https://jsoneditoronline.org
template:
test2:
{subloop-array:level2:-1} level2: {level2.key}
{subloop:level2.data:-1} id: {level2.data.id}, type: {level2.data.type}
{/subloop:level2.data} {/subloop-array:level2}
result:
Plugin-Settings (see Plugin options):
Cache: disabled
oauth Bearer Accesskey:
http-Header default Useragent:
The merged JSON and template:
test1 Very good, this is the value of 'start', right out of the JSON-data
test2:
level2: This is the first value of key in the 'level1'-array
id: 11111, type: aaaa
level2: This is the second value of key in the 'level1'-array
id: 222, type: bbbb
level2: This is the third value of key in the 'level1'-array
id: 33333333, type: aaaa
level2: This is the fourth value of key in the 'level1'-array
id: 4444, type: aaaa