Ticket #5113: text-widget.diff
| File text-widget.diff, 1.9 KB (added by , 19 years ago) |
|---|
-
widgets.php
532 532 $options = get_option('widget_text'); 533 533 $title = $options[$number]['title']; 534 534 $text = apply_filters( 'widget_text', $options[$number]['text'] ); 535 $text = $options[$number]['filter'] ? wpautop($text) : $text; 535 536 ?> 536 537 <?php echo $before_widget; ?> 537 538 <?php if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?> … … 547 548 if ( $_POST["text-submit-$number"] ) { 548 549 $newoptions[$number]['title'] = strip_tags(stripslashes($_POST["text-title-$number"])); 549 550 $newoptions[$number]['text'] = stripslashes($_POST["text-text-$number"]); 551 $newoptions[$number]['filter'] = isset($_POST["text-filter-$number"]); 550 552 if ( !current_user_can('unfiltered_html') ) 551 553 $newoptions[$number]['text'] = stripslashes(wp_filter_post_kses($newoptions[$number]['text'])); 552 554 } … … 556 558 } 557 559 $title = attribute_escape($options[$number]['title']); 558 560 $text = format_to_edit($options[$number]['text']); 561 $filter = (bool) $options[$number]['filter']; 559 562 ?> 560 563 <input style="width: 450px;" id="text-title-<?php echo $number; ?>" name="text-title-<?php echo $number; ?>" type="text" value="<?php echo $title; ?>" /> 561 564 <textarea style="width: 450px; height: 280px;" id="text-text-<?php echo $number; ?>" name="text-text-<?php echo $number; ?>"><?php echo $text; ?></textarea> 565 <label for="text-filter-<?php echo "$number"; ?>"><input type="checkbox" id="text-filter-<?php echo "$number"; ?>" name="text-filter-<?php echo "$number"; ?>" id="text-filter-<?php echo "$number"; ?>" <?php echo $filter ? "checked" : ""; ?> /> <?php _e('Automatically insert paragraphs'); ?> 562 566 <input type="hidden" id="text-submit-<?php echo "$number"; ?>" name="text-submit-<?php echo "$number"; ?>" value="1" /> 563 567 <?php 564 568 }