Support

Account

Home Forums Backend Issues (wp-admin) Shortcode in WYSIWIG field (options page) rendering IN field after save.

Solving

Shortcode in WYSIWIG field (options page) rendering IN field after save.

  • I have a WYSIWIG field on an Options page and I’m trying to use a shortcode to display a Gravity form. When I update and save the options page, it actually renders the shortcode and outputs the form and javascript tags inside the WYSIWIG field. This is kinda cool however it’s causing some problems since autop is being called forcing p tags around fields. I’m also worried that it would be easy for a user to modify or remove the script tags and break things.

    Is this expected Behavior? Will ACF always render any shortcode in a WYSIWIG field and why would this be treated differently than WordPress’s own WYSIWIG behavior, say on a post or page? If it is default behavior, can I override it for specific fields?

    Thanks for the help and let me know if I can provide any other details!

  • No, this is not expected behavior. ACF does not run shortcodes on the content when saving and loading fields in the admin. You’ve probably got something else going on. I can’t even say what since I’ve never seen this happen. More than likely another plugin or something in your theme? Try deactivating other plugins.

  • Thanks for the quick answer. I didn’t think so. After some inspection looks like it was one of my poorly written functions 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Shortcode in WYSIWIG field (options page) rendering IN field after save.’ is closed to new replies.