Make WordPress Core


Ignore:
Timestamp:
04/20/2009 07:59:46 PM (16 years ago)
Author:
ryan
Message:

Add option to run wpautop for text widget. Props Denis-de-Bernardy. fixes #5113

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-widgets.php

    r11009 r11018  
    356356        echo $before_widget;
    357357        if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
    358             <div class="textwidget"><?php echo $text; ?></div>
     358            <div class="textwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div>
    359359        <?php
    360360        echo $after_widget;
     
    368368        else
    369369            $instance['text'] = wp_filter_post_kses( $new_instance['text'] );
     370        $instance['filter'] = isset($new_instance['filter']);
    370371        return $instance;
    371372    }
     
    378379            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
    379380            <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
     381            <p><label for="<?php echo $this->get_field_id('filter'); ?>"><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked($instance['filter']); ?> />&nbsp;<?php _e('Automatically add paragraphs.') ?></label></p>
    380382<?php
    381383    }
Note: See TracChangeset for help on using the changeset viewer.