I have a form on my WordPress website where users can submit code (HTML, JS, PHP, etc.) that will get saved to the WordPress database, and that code will also be visible on a page.
How do I make sure nothing malicious is done when the code is saved to the database? I would like to save the inputted code as-is without escaping or modifying it, if possible and safe.
And what about when it is displayed on the frontend? Is echoing the saved code in tags enough?
Thanks!