Этот плагин не тестировался с последними 3 основными выпусками WordPress. Скорее всего, он уже не поддерживается и может быть несовместим с текущими версиями WordPress.

JSON Data Shortcode


This shortcode lets you pull data into your pages via JSON. Supports unlimited levels of nesting!
Built-in caching of results keeps your data providers happy, but can be tailored to your needs with a configurable lifetime.

You can use it one of two ways (but not necessarily on the same page — see this article!)

[json src="http://example.com/my_data_src?format=json" key="Data.mykey"]

—> outputs contents of mykey in the Data object

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

—> replaces the text in {} with contents of otherKey in the mysubdata object in the Data object

Note: this plugin allows you to bring content from remote sites into your posts. Please exercise caution, especially if you allow posting by untrusted users.


Download and install using the built in WordPress plugin installer.
Activate in the «Plugins» admin panel using the «Activate» link.

Часто задаваемые вопросы

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.


Нет отзывов об этом плагине.

Участники и разработчики

«JSON Data Shortcode» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:


Перевести «JSON Data Shortcode» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений


  • Added: JSON Shortcode Diagnostic page to test shortcode syntax


  • Changed: decode HTML entities in src URLs (to ensure support for multiple query parameters) — thanks, bakedbeing


  • Fixed: fatal error when wp_remote_get returned a WP_Error object
  • Changed: use native json_encode/json_decode when available for better performance


  • Initial release