Plugin Directory

Changeset 367680


Ignore:
Timestamp:
03/31/2011 09:07:03 PM (15 years ago)
Author:
bigsmoke
Message:

wpautop-control plugin: clarified option screen and added more flexible handling of custom field values.

Location:
wpautop-control/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpautop-control/trunk/readme.txt

    r323703 r367680  
    88Stable tag: 1.0
    99
    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 cutom field.
     10Adds 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.
    1111
    1212== Description ==
     
    2424
    2525* 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  
    2828    <form method="post" action="options.php">
    2929      <?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>&lt;br /&gt;</tt> or <tt>&lt;p&gt;</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
    3033      <table class="form-table">
    3134        <tr valign="top">
    3235          <th scope="row">wpautop filter on by default?</th>
    3336          <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>
    3639          </td>
    3740      </table>
     
    6366    if ( empty($post_wpautop_value) )
    6467      $remove_filter = ! $default_wpautop_value;
    65     elseif ($post_wpautop_value == 'true')
     68    elseif ( in_array($post_wpautop_value, array('true', 'on', 'yes')) )
    6669      $remove_filter = false;
    67     elseif ($post_wpautop_value == 'false')
     70    elseif ( in_array($post_wpautop_value, array('false', 'off', 'no')) )
    6871      $remove_filter = true;
    6972
Note: See TracChangeset for help on using the changeset viewer.