Given that you are dealing with email, I’d run wp_kses()
with a very limited $allowed_html
array similar to this sample from the Codex:
array(
'a' => array(
'href' => array(),
'title' => array()
),
'br' => array(),
'em' => array(),
'strong' => array(),
);
HTML rendering is even more squirrelly in email readers than browsers (and there are a lot more readers to worry about) so you want to be very careful what you allow. That is going to mean that you will need to truncate the visual option in your editor too. I am sure there are posts here about doing that.
All in all, I’ll consider using a very simple markdown and skipping the complexity of the editor completely.
Related Posts:
- Settings API – sanitizing urls, email addresses and text
- add static page to reading settings for custom post type
- How to display an admin notice after updating plugin settings?
- Settings API – sanitize_callback is not called and it leads to an incorrect behavior
- WordPress Settings API – Sanitize Integer
- Preserve old values on error in setting API
- Seeking clarity on data sanitization fields for settings textarea
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error
- update_option_$option action not working as expected
- Getting all the settings for a plugin
- How to handle complex data with Settings API
- settings api and the data passed in the parameter
- How to save Checkbox-Options in Plugin Options Page
- Custom setting field value not working inside add_action init hook
- Settings api sanatize callback not being triggered
- Can I use add_option for a plugin categories and how?
- illegal offset in option add
- How to sanitize settings API value
- Add multiple custom fields to the general settings page
- Settings API vs Theme Customizer
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- How to pass arguments from add_settings_field() to the callback function?
- Is get_option function cached?
- How to pass variable to add_settings_section() callback?
- What are the advantages to the Settings API?
- Run function AFTER theme options are saved?
- Where to store plugin settings fields
- WordPress Settings API, Implementing Tabs On Custom Menu Page
- Difference between Option_Group and Option_Name in Register_Settings
- What’s the best method for emptying an option created with the Settings API?
- Settings API – easiest way of validating checkboxes?
- Add your own settings page for plugin
- Settings API – creating reusable form elements?
- Adding an html editor to plugin settings page
- Settings API – changing add_settings_field() output?
- Add settings fields on options discussion admin page
- register_setting() vs add_option()
- Settings API – save an array of options as one setting (array_push?)
- Validate an option array
- Default WordPress settings API data sanitization
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- Custom plugin settings: clicking “save changes” does not display success message
- Dynamic settings fields with Settings API
- Settings API repeater fields
- Setting ‘autoload’ to ‘no’ with Settings API
- Add Settings to Custom Post Type
- do_settings_sections() doesn’t escape quotes
- How to Save Different Settings Options Using Settings API and/or the Theme Optimizer
- Serialized settings in rest api
- Can’t output do_settings_sections . Can’t understand why
- Import / Export Settings API fields values?
- Why won’t register_setting() create a setting?
- Settings API erases itself?
- Saving multiple checkboxes with WordPress settings api
- Settings API – how to update multiple options manually?
- Possible to add another setting to ‘Front page displays’ setting for Custom Post Type
- Setting the uploads directory
- Single callback with multiple setting fields
- Letting user dynamically create fields using Settings API
- Settings API – how to update options manually?
- Cannot update my options using wp_ajax
- how can I detect that option value has changed?
- wordpress settings api add fields
- Adding labels to Setting titles with API
- array_map() for sanitizing $_POST
- register_setting sanitize callback $input is null
- Can I dynamically create duplicate fields with the Settings API?
- How to display some settings for super admin user only using Settings API
- Performance of several get_option() calls
- Extend plugin options page
- Settings API – input always updates over validation
- What exactly is the purpose of settings_fields()?
- Can I use the different settings sections over different pages using the save options group?
- Is there a limit to the number of options you can store in one settings field of wp_options?
- Persist fields with Setting API
- wordpress settings API and option array structure
- Echo all API Settings sections?
- Settings Page won’t save
- Settings API get_option best practices
- Custom theme options Radio inputs not saving
- How do I save custom options on the options page ‘Reading’?
- Settings API – generating field value based on a different field?
- Submit options page input values with decimals
- Correct way check nonce (security) using old Options API
- Settings API: Change position of custom setting field
- Using multiple settings_fields() on 1 settings page
- Settings API store serialized data in the database (The Right Way)
- Tab from Settings API resetting all options with INSERT INTO [closed]
- Getting settings saved two times in settings page with tab
- How to get bool with `get_option()` when already registered setting with type `boolean`
- Output ‘do_settings_sections()’ as tabs, not one under the other
- Saving plugin’s settings in 1 field in json format
- get_option array value defaults and best practices
- PHP Notice: Undefined offset: 0 in /wordpress/wp-includes/plugin.php and Register Settings API change
- Hide output of add_settings_field()
- How to make new plugin setting checkbox default as checked
- How to add settings subpage from a plugin to a settings page created in theme?
- How to wrap html around Settings API add_settings_section()
- Remove Internal Style Sheet if no Value Provided?
- Can’t get plugin settings page to save data