Bypass field sanitization
Hi all,
When trying to create some custom widgets that take embed code from various websites, I’ve noticed that my content is sanitized before it even reaches my custom sanitizer.
add_action( 'init', function() {
add_filter( 'siteorigin_widgets_sanitize_field_raw', function ($value) {
return $value;
});
});Is there a way to avoid this without adding the various tags/attributes to the allowed_html within WordPress?
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
2Hi Gavin,
I’m going to forward this off to the development team as this might actually be a bug.
Hey Alex,
Apologies, when I tried to reply soon after creating my account, it wouldn’t allow me (white page.)
I got around it by creating my own input type, however the textarea field inherits from the input field, which by default sanitizes using wp_kses_post, wiping out any HTML content. Unfortunately you lose any raw content when your custom sanitizer kicks in.
Thanks :)
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.