[wp-trac] [WordPress Trac] #41394: Custom HTML widget applies widget_text filters with unexpected $instance data

WordPress Trac noreply at wordpress.org
Fri Jul 21 14:31:39 UTC 2017


#41394: Custom HTML widget applies widget_text filters with unexpected $instance
data
--------------------------+--------------------------
 Reporter:  westonruter   |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.8.1
Component:  Widgets       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------

Comment (by obenland):

 {{{
 #!php
 <?php
 // Prepare instance data that looks like a Text widget.
 $simulated_text_widget_instance = wp_parse_args( array(
         'text'   => $instance['content'],
         'filter' => false, // Because wpautop is not applied.
 ), $instance );
 }}}
 Might be a little easier to grok. It shouldn't matter if `content` remains
 or not.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41394#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list