WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

JSON Data Shortcode

Load data via JSON and display it in your posts and pages - even to spiders or visitors with JavaScript disabled

URLs are too long! Can I shorten my JSON shortcodes?

Use the name attribute to define a friendly name for your data source! The scope of this name is only the post / page you name it. Also note that using the name attribute more or less restricts you to the self-closing format, because of shortcode parser limitations.

[json src="http://example.com/my_data_src?format=json" name="ExampleData"]

Later in the same page...

[json name="ExampleData" key="Data.mykey"]

--> outputs contents of mykey in the Data object

How can I control how frequently my data is refreshed?

Use the lifetime parameter! This parameter is in seconds, is per source, and should be set the same for all references to that source on a post / page for best results.

[json src="http://example.com/my_data_src?format=json" lifetime="300"]I want my value to appear right here {myData} in the middle of my content.[/json]

--> Will expire the cached data after 5 minutes.

Does this work with caching?

Yes! Any output caching system will cache your post with JSON data included. However, your data will only be checked for expiration when your site builds the post, so time your cache expiration accordingly.

Requires: 3.0 or higher
Compatible up to: 3.5.2
Last Updated: 2012-5-31
Downloads: 1,053

Ratings

3 stars
3 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1