stripslashes(wp_filter_post_kses(addslashes($_POST['sidebar_code'])));
but you should know that the kses filter is not 100% safe.
Related Posts:
- What characters do I need to escape in XML documents?
- What characters must be escaped in HTML 5?
- How can I selectively escape percent (%) in Python strings?
- How do I escape a single quote in jQuery?
- Escape Character in SQL Server
- How to escape apostrophe (‘) in MySql?
- Should HTML output be passed through esc_html() AND wp_kses()?
- How to correctly escape query variables to be used in WP_Query
- How to escape custom css?
- esc_attr / esc_html / esc_url in echos
- When do I need to use esc_html()? [duplicate]
- what’s different between esc_attr, htmlspecialchars and htmlentities
- esc_url not working within add_settings_field callback
- Allow all attributes in $allowedposttags tags
- When outputting a static string to the page, is it necessary to escape the output?
- How Flexible are the WordPress Coding Standards for PHPCS?
- why is esc_html() returning nothing given a string containing a high-bit character?
- How to properly escape a translated string?
- Translate a Constant while appeasing WordPress PHPCS
- Using esc_url() on a url more than once
- Do I need to escape get_theme_mod(‘url’) / (‘mail’) with esc_url?
- How to allow   with wp_kses()?
- Using esc_attr_e
- Why esc_html_() is not used on every text that has a translation (on Twenty Twenty One)?
- Escaping crashes my output
- How to safely escape the title attribute
- Do we need to escape data that we receive from theme options?
- How to safely escape data that contains HTML attributes
- Can wp_strip_all_tags be used as a substitute for esc_url, esc_attr & esc_html?
- Echoing a URL to a link
- wp_kses_post escaping doesn’t appear to work as described?
- file_get_contents | escaping doesnt show the page
- Help about Escaping
- How to keep specific tag from an html string?
- Escaping Issues
- Escaping and Special Characters (e.g. &)
- Escaping get_option( ‘time_format’ ) is nesserary?
- How should esc_url be combined with trailingslashit?
- Correct way of using esc_attr() and esc_html()
- Which characters need to be escaped when using Bash?
- Adding a checkbox to the theme customizer
- Best practices for a Style/CSS based theme options page?
- How to add Color Picker in Theme Options for the following?
- Uploading files in admin panel?
- Best practice way to implement custom sections into a WordPress theme
- Do you need to escape hard coded plain text?
- Add a preview to a WordPress Control Panel
- Separate backend “Widgets” page for each language
- How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?
- How to make alert for new version on theme options?
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Does uninstalling a WordPress theme delete its database values?
- How to set different settings for a mobile theme?
- Escape post image attachments added to template
- What’s the proper way to include inlined javascript-source?
- Choose To Display Post Views With An Options Panel
- Base64 & JSON Encode array in PHP, use as HTML data attribute, decode and parse in JavaScript …. with proper Escaping
- Set the checkbox as checked by default at options page
- How to add “Template” option in page attributes panel?
- Add Metabox to settings / options page
- Getting the ID of header image, even when set to random
- How to support letting users add their OWN logo to a custom theme?
- Option Tree integration of Custom CSS
- Settings API settings section not appearing
- How can I change the theme of different posts using a plugin?
- How to get of_get_option() inside the inc folder file
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Issue with theme mod options during domain migration
- Shortcode don’t work in custom option field, any solution?
- How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?
- WordPress Theme Settings Page
- How To Display Value from Theme Options Field in Front End Template?
- Update Specific Key Value in Complex `wp_options` object
- Upload images – Theme options
- How to use checked() function with multiple check box group? How to properly sanitize that checkbox group?
- what does $options = get_option(‘test_theme’); do?
- Tabbed theme options query about add_settings_section callback function
- WordPress karma theme shortcodes not working
- How do I have my widgets in a Sidebar for my http://localhost/wordpress/
- echo cutom css code to WordPress page template file ? is this safe?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Remove pre and code tags from WordPress
- Swap themes locally
- admin menu: use default “general” page for theme settings using add_menu_page and add_submenu_page
- Correct form of escaping and localization – functions.php breadcrumbs
- how to create a section inside a section with theme options customizer
- Escaping a Single Quote in str_replace for Nav Function
- Theme options on CPT
- Theme page headers and rotator images not assigned after website migration
- Escaping and sanitization
- Warning: call_user_func() expects parameter 1 to be a valid callback
- SAving PHP in custom wordpress option field
- How to display post meta data in secure manner
- Slightly modified options framework Colour picker
- trying to figure out how to use more that one image upload in the same section in theme customizer
- Create /archive page in WordPress Theme
- How do I display a full post, not just an excerpt?
- Setting field not saving on front-end
- How to support special characters in text field?
- Multiple Custom Headers