Changeset 367680
- Timestamp:
- 03/31/2011 09:07:03 PM (15 years ago)
- Location:
- wpautop-control/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wpautop-control.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpautop-control/trunk/readme.txt
r323703 r367680 8 8 Stable tag: 1.0 9 9 10 Adds a global setting to turn the wpautop filter on and off. It also allows you to override this default for any post by adding a wpautop cu tom field.10 Adds a global setting to turn the wpautop filter on and off. It also allows you to override this default for any post by adding a wpautop custom field. 11 11 12 12 == Description == … … 24 24 25 25 * First release 26 27 = 1.1 = 28 29 * Clarified option screen. It seemed to be causing confusion. 30 • Instead of just true/false, you can now also use yes/no or on/off in the wpautop custom field. -
wpautop-control/trunk/wpautop-control.php
r323658 r367680 28 28 <form method="post" action="options.php"> 29 29 <?php settings_fields('wpautop-control') ?> 30 31 <p>Normally, WordPress filters your posts' content using the wpautop filter. Roughly, what this filter does is that it replaces newlines and empty lines with <tt><br /></tt> or <tt><p></tt>. The setting below lets you turn this filter on or off. (You can later override it on a post-by-post basis by setting the wpautop custom field to ‘true’ or ‘false’.)</p> 32 30 33 <table class="form-table"> 31 34 <tr valign="top"> 32 35 <th scope="row">wpautop filter on by default?</th> 33 36 <td> 34 <label><input type="radio" name="wpautop_on_by_default" value="1" <?php if ( get_option('wpautop_on_by_default') == '1' ) echo 'checked="1"' ?>> yes </label>35 <label><input type="radio" name="wpautop_on_by_default" value="0" <?php if ( get_option('wpautop_on_by_default') == '0' ) echo 'checked="1"' ?>> no </label>37 <label><input type="radio" name="wpautop_on_by_default" value="1" <?php if ( get_option('wpautop_on_by_default') == '1' ) echo 'checked="1"' ?>> yes <small>(WordPress' default behaviour)</small></label><br /> 38 <label><input type="radio" name="wpautop_on_by_default" value="0" <?php if ( get_option('wpautop_on_by_default') == '0' ) echo 'checked="1"' ?>> no <small>(turn of WordPress' auto-formatting, except for selected posts)</small></label> 36 39 </td> 37 40 </table> … … 63 66 if ( empty($post_wpautop_value) ) 64 67 $remove_filter = ! $default_wpautop_value; 65 elseif ( $post_wpautop_value == 'true')68 elseif ( in_array($post_wpautop_value, array('true', 'on', 'yes')) ) 66 69 $remove_filter = false; 67 elseif ( $post_wpautop_value == 'false')70 elseif ( in_array($post_wpautop_value, array('false', 'off', 'no')) ) 68 71 $remove_filter = true; 69 72
Note: See TracChangeset
for help on using the changeset viewer.