Changeset 7568
- Timestamp:
- 01/25/07 00:24:53 (1 year ago)
- Files:
-
- wp-unformatted/trunk/README.txt (modified) (1 diff)
- wp-unformatted/trunk/wp-unformatted.php (modified) (3 diffs)
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 === 2 Tags: texturize, autop, formatting 3 Contributors: alexkingorg 4 Requires at least: 2.0 5 Tested up to: 2.1 6 Stable tag: 1.1 3 7 4 NOTE: This only works with WordPress 1.2 (and later).8 The WP Unformatted plugin allows you to remove WordPress's smart quotes (texturize) and auto XHTML tags (autop) functionality on a per-post basis. 5 9 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 == 7 11 8 Step 1. 12 1. Download the plugin archive and expand it (you've likely already done this). 13 2. Put the 'wp-unformatted.php' file into your wp-content/plugins/ directory. 14 3. Go to the Plugins page in your WordPress Administration area and click 'Activate' for WP Unformatted. 9 15 10 Put the wp-unformatted.php file in your wp-content/plugins/ directory. 16 == Usage == 11 17 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 = 21 19 22 20 To disable auto-formatting on a post, add a custom field 'sponge' with a value of '1' to the post. 23 21 22 = Disable Smart Quotes = 23 24 24 To disable auto-smart-quotes on a post, add a custom field 'sandpaper' with a value of '1' to the post. 25 25 26 == Known Issues == 26 27 27 That's it, have fun! 28 None. 28 29 29 --Alex 30 http://www.alexking.org/ 30 == Frequently Asked Questions == 31 32 = Anything else? = 33 34 That about does it - enjoy! 35 36 --Alex King 37 38 http://alexking.org/projects/wordpress wp-unformatted/trunk/wp-unformatted.php
r4121 r7568 2 2 3 3 // WP Unformatted 4 // version 1. 0, 2004-05-214 // version 1.1, 2007-01-24 5 5 // 6 // Copyright (c) 2004 Alex King7 // http:// www.alexking.org/software/wordpress/6 // Copyright (c) 2004-2007 Alex King 7 // http://alexking.org/projects/wordpress 8 8 // 9 9 // This is an add-on for WordPress … … 18 18 /* 19 19 Plugin Name: WP Unformatted 20 Plugin URI: http:// www.alexking.org/software/wordpress/20 Plugin URI: http://alexking.org/projects/wordpress 21 21 Description: 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. 022 Version: 1.1 23 23 Author: Alex King 24 Author URI: http:// www.alexking.org/24 Author URI: http://alexking.org 25 25 */ 26 26 27 27 // conditional auto-p function 28 28 function 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; 32 32 } 33 33 else { 34 return $pee;34 return wpautop($pee); 35 35 } 36 36 } … … 38 38 // conditional texturize function 39 39 function 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; 43 43 } 44 44 else { 45 return $text;45 return wptexturize($text); 46 46 } 47 47 }
