$text =
apply_filters( 'the_editor_content',
$instance['text'
],
$default_editor );
// Reset filter addition.
if ( user_can_richedit() ) { remove_filter( 'the_editor_content', 'format_for_editor'
);
} // Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing.
$escaped_text =
preg_replace( '#</textarea#i', '</textarea',
$text );
?>
<input id="<?php
echo $this->
get_field_id( 'title'
); ?>" name="<?php
echo $this->
get_field_name( 'title'
); ?>" class="title sync-input" type="hidden" value="<?php
echo esc_attr( $instance['title'
] ); ?>">
<textarea id="<?php
echo $this->
get_field_id( 'text'
); ?>" name="<?php
echo $this->
get_field_name( 'text'
); ?>" class="text sync-input" hidden><?php
echo $escaped_text; ?></textarea>
<input id="<?php
echo $this->
get_field_id( 'filter'
); ?>" name="<?php
echo $this->
get_field_name( 'filter'
); ?>" class="filter sync-input" type="hidden" value="on">
<input id="<?php
echo $this->
get_field_id( 'visual'
); ?>" name="<?php
echo $this->
get_field_name( 'visual'
); ?>" class="visual sync-input" type="hidden" value="on">
<?php
else : ?>
<input id="<?php
echo $this->
get_field_id( 'visual'
); ?>" name="<?php
echo $this->
get_field_name( 'visual'
); ?>" class="visual" type="hidden" value="">
<p>
<label for="<?php
echo $this->
get_field_id( 'title'
); ?>"><?php
_e( 'Title:'
); ?></label>
<input class="widefat" id="<?php
echo $this->
get_field_id( 'title'
); ?>" name="<?php
echo $this->
get_field_name( 'title'
); ?>" type="text" value="<?php
echo esc_attr( $instance['title'
] ); ?>" />
</p>
<div class="notice inline notice-info notice-alt">
<?php
if ( !
isset( $instance['visual'
] ) ) : ?>