• Currently adding shortcode to an acf field on single custom posts. The shortcode works when viewing a single custom post type.

    However I also have an ajax request that will query a single custom post and render all the content from this custom post. I’m also including the shortcode in the response, but it just renders the shortcode text. Debugging I then checked in the Ajax response if the shortcode exists and it does not exist when using admin Ajax url etc.

    If I use any other shortcode from other plugins in that same field they work fine both when viewing the single post, or when getting the post from Ajax request. I also created a custom shortcode to test and it works as well.

    Are you aware of this? Ever seen this before, maybe something with how you register your shortcode. Or maybe the action hook you’re using to register the shortcode.

  • The topic ‘Shortcode does not work when called from Ajax.’ is closed to new replies.