wordpress shortcode inside json output from jquery request

wordpress-jquery
[Total: 0    Average: 0/5]

shortcode is a common way form wordpress to get some nice result from some plug in. The shortcode is processed by the server that provides as output javascript code after executed by the local browser.

Some advanced WordPress developer can add some jquery code inside. The jquery code can interact with the remote database (with a wrapper written in php) and get some result. Often this result is in json format. This json is decoded using jquery code in the local browser before to show the result to the browser.

Unfortunately the json output cannot have the shortcode inside because this, as we said before must be processed on the server and not processed to the client.

A solution is to decode the shortcode in the php wrapper and provide the decoded result in the json output.

query2json_with_shortcode (function defined inside show_channel_paginate_js.php)
 
jquerycode.js