Changeset 7568

Show
Ignore:
Timestamp:
01/25/07 00:24:53 (1 year ago)
Author:
alexkingorg
Message:

version 1.1, compatible with WP 2.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-unformatted/trunk/README.txt

    r668 r7568  
    1 WP Unformatted README 
    2 version 1.0, 2004-05-21 
     1=== WP Unformatted === 
     2Tags: texturize, autop, formatting 
     3Contributors: alexkingorg 
     4Requires at least: 2.0 
     5Tested up to: 2.1 
     6Stable tag: 1.1 
    37 
    4 NOTE: This only works with WordPress 1.2 (and later)
     8The WP Unformatted plugin allows you to remove WordPress's smart quotes (texturize) and auto XHTML tags (autop) functionality on a per-post basis
    59 
    6 With this enabled, you can add a custom field of 'sponge' set to '1' to a post to disable the auto formatting and a custom field of 'sandpaper' set to '1' to a post to disable the auto smart-quote conversion. 
     10== Installation == 
    711 
    8 Step 1. 
     121. Download the plugin archive and expand it (you've likely already done this). 
     132. Put the 'wp-unformatted.php' file into your wp-content/plugins/ directory. 
     143. Go to the Plugins page in your WordPress Administration area and click 'Activate' for WP Unformatted. 
    915 
    10 Put the wp-unformatted.php file in your wp-content/plugins/ directory.  
     16== Usage == 
    1117 
    12  
    13 Step 2. 
    14  
    15 Enable the plugin in your options. 
    16  
    17 Click on 'Plugins' in the admin area, then 'Activate' next to the WP Unformatted row. 
    18  
    19  
    20 Step 3. 
     18= Disable Adding XHTML Tags = 
    2119 
    2220To disable auto-formatting on a post, add a custom field 'sponge' with a value of '1' to the post.  
    2321 
     22= Disable Smart Quotes = 
     23 
    2424To disable auto-smart-quotes on a post, add a custom field 'sandpaper' with a value of '1' to the post.  
    2525 
     26== Known Issues == 
    2627 
    27 That's it, have fun! 
     28None. 
    2829 
    29 --Alex 
    30 http://www.alexking.org/ 
     30== Frequently Asked Questions == 
     31 
     32= Anything else? = 
     33 
     34That about does it - enjoy! 
     35 
     36--Alex King 
     37 
     38http://alexking.org/projects/wordpress 
  • wp-unformatted/trunk/wp-unformatted.php

    r4121 r7568  
    22 
    33// WP Unformatted 
    4 // version 1.0, 2004-05-21 
     4// version 1.1, 2007-01-24 
    55// 
    6 // Copyright (c) 2004 Alex King 
    7 // http://www.alexking.org/software/wordpress/ 
     6// Copyright (c) 2004-2007 Alex King 
     7// http://alexking.org/projects/wordpress 
    88// 
    99// This is an add-on for WordPress 
     
    1818/* 
    1919Plugin Name: WP Unformatted 
    20 Plugin URI: http://www.alexking.org/software/wordpress/ 
     20Plugin URI: http://alexking.org/projects/wordpress 
    2121Description: With this enabled, you can add a custom field of 'sponge' set to '1' to a post to disable the auto formatting and a custom field of 'sandpaper' set to '1' to a post to disable the auto smart-quote conversion. 
    22 Version: 1.0 
     22Version: 1.1 
    2323Author: Alex King 
    24 Author URI: http://www.alexking.org/ 
     24Author URI: http://alexking.org 
    2525*/  
    2626 
    2727// conditional auto-p function 
    2828function wp_sponge($pee) { 
    29       global $post, $post_meta_cache
    30       if (!isset($post_meta_cache[$post->ID]['sponge'][0]) || $post_meta_cache[$post->ID]['sponge'][0] != 1) { 
    31             return wpautop($pee)
     29      global $post
     30      if (get_post_meta($post->ID, 'sponge', true) == '1') { 
     31            return $pee
    3232      } 
    3333      else { 
    34             return $pee
     34            return wpautop($pee)
    3535      } 
    3636} 
     
    3838// conditional texturize function 
    3939function wp_sandpaper($text) { 
    40       global $post, $post_meta_cache
    41       if (!isset($post_meta_cache[$post->ID]['sandpaper'][0]) || $post_meta_cache[$post->ID]['sandpaper'][0] != 1) { 
    42             return wptexturize($text)
     40      global $post
     41      if (get_post_meta($post->ID, 'sandpaper', true) == '1') { 
     42            return $text
    4343      } 
    4444      else { 
    45             return $text
     45            return wptexturize($text)
    4646      } 
    4747}