Ticket #19411: 19411.3.diff
File 19411.3.diff, 2.4 KB (added by , 13 years ago) |
---|
-
wp-includes/default-filters.php
194 194 add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); 195 195 add_filter( 'editable_slug', 'urldecode' ); 196 196 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); 197 add_filter( 'widget_text', 'shortcode_unautop' );197 add_filter( 'widget_text', array( 'WP_Widget_Text', 'wpautop' ), 10, 2 ); // dependent on the widget setting 198 198 add_filter( 'widget_text', 'do_shortcode' ); 199 199 200 200 // Actions -
wp-includes/default-widgets.php
374 374 } 375 375 376 376 function widget( $args, $instance ) { 377 extract( $args);377 extract( $args ); 378 378 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); 379 $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );379 $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance, $this->id_base ); 380 380 echo $before_widget; 381 if ( ! empty( $title ) ) { echo $before_title . $title . $after_title; } ?>382 <div class="textwidget"><?php echo !empty( $instance['filter'] ) ? wpautop( $text ) :$text; ?></div>381 if ( ! empty( $title ) ) { echo $before_title . $title . $after_title; } ?> 382 <div class="textwidget"><?php echo $text; ?></div> 383 383 <?php 384 384 echo $after_widget; 385 385 } … … 408 408 <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs'); ?></label></p> 409 409 <?php 410 410 } 411 412 static function wpautop( $text, $instance ) { 413 if ( ! empty( $instance['filter'] ) ) { 414 $text = wpautop( $text ); 415 if ( has_filter( 'widget_text', 'do_shortcode' ) ) 416 $text = shortcode_unautop( $text ); 417 } 418 return $text; 419 } 411 420 } 412 421 413 422 /**