Trying to allow storing of script tags in fields. I enter something like:
<script>console.log('hello, world');</script>
And save, but after page reload I get:
console.log('hello, world');
How do I allow script tags to be stored in custom fields?
What type of field is it? What WP editor are you using?
@hube2 it is a textarea field type. I’m not sure the exact answer to your second question — I guess we’re using the older style editor and not Gutenberg? Here’s a screenshot anyway, with the field at the bottom, showing what I see after saving (script tags removed): https://www.evernote.com/l/AD-gkCiwZVVKuLS14902esj08jJiqAt2-bY
The answer is that you’re using multisite and by default only super admins are allowed to save scripts in fields. See this topic https://support.advancedcustomfields.com/forums/topic/script-tags-stripped-from-text-area-for-admin-user/
@hube2 ah excellent, this explains why I didn’t have the issue locally, since I’m not running MU locally. I’ll try this out and close the topic if it works, thanks!