I am trying to:
Here is a video about what I am trying to do and the error I am getting hidden link
Link to a page where the issue can be seen:
hidden link
I expected to see:
The expectation is to be able to save this content template without any issue or error!
Instead, I got:
I am getting this error message: Updating failed. Unexpected token '<', "<div class"... is not valid JSON
Hi,
Thank you for contacting us and I'd be happy to assist.
I noticed that the "wdm_my_subscription" custom shortcode was returning its output much sooner when the content template editor screen was getting loaded, which was breaking the page's markup.
I've updated the shortcode's code to get the output as an object first and then return it, which seems to have fixed it:
add_shortcode('wdm_my_subscription', 'wmd_my_custom_function');
function wmd_my_custom_function(){
ob_start();
WCS_Template_Loader::get_my_subscriptions();
return ob_get_clean();
}
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar