Updating a page with custom shortcodes
-
When I attempt to save a page with a custom shortcode, I get the following error message:
Updating failed. The response is not a valid JSON response.
Not sure, what it is, but it is definitely linked to my custom shortcode function. Doing a google search, I found the following workaround:
function myshortcode(){ ob_start(); <em>My logic for the shortcode</em> $content = ob_get_contents(); ob_end_clean(); return $content; }
Whilst the above solution works, I’ve not seen this solution covered in any official wordpress description of how to code custom shortcode functions. Clearly this solution has implications on all installations, so I think there must be something I am missing….
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.