I am slightly stuck on creating a widget, it has an input (bit like the default text widget) but got an issue adding html into it.
My code is:
$instance['content'] = ( ! empty( $new_instance['content'] ) ) ? esc_html( $new_instance['content'] ) : '';
This works partially as it let me saves the HTML (an iframe) but displays it as code in the frontend, I need it to convert the iframe code to a working video.
I have also tried:
$instance['content'] = ( ! empty( $new_instance['content'] ) ) ? strip_tags( $new_instance['content'] ) : '';
but it won't let me save the iframe content (it clears the box).
Which function do I need to use so my widget behaves the same as the default text widget.