• Resolved robobobo100

    (@robobobo100)


    Hey,

    So I’m using this plugin to pull in a json feed for my mobile app. I then parse this to list the stories etc..

    One problem I have however is that we use a number of shortcodes for things like graphs and galleries on the site. These are all outputted in the json response, however I don’t want them to be (as they generally don’t work as intended in a mobile app)

    I’ve been trying to figure out how I can hook in and remove the shortcodes (using remove_shortcode) from the content when the request is coming from the app but I can’t seem to get a way which will tell me the request is coming from the app.

    I’ve tried parsing the request url to see if it contains json=1 and this does work when I access the url via a browser. But when it’s accessed via ajax (jsonp request) it doesn’t pick it up.

    Is there anyway I can tell if the request is using the json-api plugin?

    Something like

    if(is_json()){
    //remove shortcodes
    }

    Is exactly what I need. Is there any global variable set or anything I can hook onto?

    Thanks

    https://www.ads-software.com/plugins/json-api/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How To Modify Output Of Content’ is closed to new replies.