Permalink
Browse files

adding version 1.4.2 from http://svn.wp-plugins.org/wpuntexturize/tag…

  • Loading branch information...
0 parents commit 21e4092c0369ac9d4b00244a6bae67d49f36c2a9 Sean Klein committed Feb 3, 2012
Showing with 285 additions and 0 deletions.
  1. +189 −0 readme.txt
  2. +96 −0 wpuntexturize.php
@@ -0,0 +1,189 @@
+=== wpuntexturize ===
+Contributors: coffee2code
+Donate link: http://coffee2code.com/donate
+Tags: quotes, curly, substitutions, wptexturize, post, content, coffee2code
+Requires at least: 1.5
+Tested up to: 3.3
+Stable tag: 1.4.2
+Version: 1.4.2
+
+Prevent WordPress from displaying single and double quotation marks as their curly alternatives.
+
+
+== Description ==
+
+Prevent WordPress from displaying single and double quotation marks as their curly alternatives.
+
+Despite the unfortunately misleading name, this plugin is NOT the antithesis of WordPress's `wptexturize()` function. This ONLY prevents WordPress from making HTML entity code substitutions of single and double quotation marks with their curly alternatives and does NOT prevent `wptexturize()` from making any other character and string substitutions.
+
+*Advanced:* The plugin performs a wpuntexturize on every filter that WordPress applies the wptexturize to by default. This list comprises:
+
+* comment_author
+* term_name
+* link_name
+* link_description
+* link_notes
+* bloginfo
+* wp_title
+* widget_title
+* single_post_title
+* single_cat_title
+* single_tag_title
+* single_month_title
+* nav_menu_attr_title
+* nav_menu_description
+* term_description
+* the_title
+* the_content
+* the_excerpt
+* comment_text
+* list_cats
+* widget_text
+
+This complete list can be filtered via wpuntexturize's own filter, `wpuntexturize_filters`.
+
+Links: [Plugin Homepage](http://coffee2code.com/wp-plugins/wpuntexturize/) | [Plugin Directory Page](http://wordpress.org/extend/plugins/wpuntexturize/) | [Author Homepage](http://coffee2code.com)
+
+
+== Installation ==
+
+1. Unzip `wpuntexturize.zip` inside the `/wp-content/plugins/` directory (or install via the built-in WordPress plugin installer)
+1. Activate the plugin through the 'Plugins' admin menu in WordPress
+
+
+== Frequently Asked Questions ==
+
+= Why are certain characters in my posts still being replaced by their HTML entity encoded version? =
+
+This ONLY prevents WordPress from making HTML entity code substitutions of single and double quotation marks with their curly alternatives and does NOT prevent WordPress from making any other character and string substitutions.
+
+= What text does this plugin modify (aka filter)? =
+
+This plugin potentially modifies the post content, excerpt, title, comment text, widget text, and more. See the description for a complete list of filters that are unfiltered.
+
+
+== Filters ==
+
+The plugin is further customizable via two filters. Typically, these customizations would be put into your active theme's functions.php file, or used by another plugin.
+
+= c2c_wpuntexturize (filter) =
+
+The 'c2c_wpuntexturize' filter allows you to use an alternative approach to safely invoke `c2c_wpuntexturize()` in such a way that if the plugin were deactivated or deleted, then your calls to the function won't cause errors in your site. This only applies if you use the function directly, which is not typical usage for most users.
+
+Arguments:
+
+* none
+
+Example:
+
+Instead of:
+
+`<?php echo c2c_wpuntexturize( $mytext ); ?>`
+
+Do:
+
+`<?php echo do_action( 'c2c_wpuntexturize', $mytext ); ?>`
+
+= wpuntexturize_filters (filter) =
+
+The 'wpuntexturize_filters' filter allows you to customize what filters to hook to be filtered with wpuntexturize. See the Description section for a complete list of all filters that are filtered by default.
+
+Arguments:
+
+* array $filters : the default array of filters
+
+Example:
+
+`add_filter( 'wpuntexturize_filters', 'more_wpuntexturize_filters' );
+function more_wpuntexturize_filters( $filters ) {
+ $filters[] = 'event_description';
+ return $filters;
+}`
+
+
+== Changelog ==
+
+= 1.4.2 =
+* Note compatibility through WP 3.3+
+* Minor code formatting (spacing)
+* Add link to plugin directory page to readme.txt
+* Update copyright date (2012)
+
+= 1.4.1 =
+* Note compatibility through WP 3.2+
+* Fix plugin homepage and author links in description in readme.txt
+
+= 1.4 =
+* Rename `wpuntexturize()` to `c2c_wpuntexturize()` (but maintain a deprecated version for backwards compatibility)
+* Rename file `wpuntexturize` to `c2c_wpuntexturize` (but maintain a deprecated version for backwards compatibility)
+* Add link to plugin homepage in readme.txt description
+
+= 1.3.2 =
+* Note compatibility through WP 3.1+
+* Update copyright date (2011)
+
+= 1.3.1 =
+* Fix two bugs (missing close parenthesis and typo)
+
+= 1.3 =
+* Rename 'wpuntexturize' filter to 'wpuntexturize_filters' to more accurately reflect its purpose (and to prevent conflict for new use of the filter name)
+* Add filter 'wpuntexturize' so that users can use the do_action('wpuntexturize') notation for invoking the function
+* Add c2c_init_wpuntexturize() to handle initialization
+* Remove docs from top of plugin file (all that and more are in readme.txt)
+* Add Filters section to readme.txt
+
+= 1.2 =
+* Allow filtering of the list of filters to be untexturized, via 'wpuntexturize' filter
+* Now unfilter everything that wptexturize is applied to by default, which now includes these filters: comment_author, term_name, link_name, link_description, link_notes, bloginfo, wp_title, widget_title, single_cat_title, single_tag_title, single_month_title, nav_menu_attr_title, nav_menu_description, term_description
+* Wrap functions in function_exists() check to be safe
+* Note compatibility with WP 3.0+
+* Add Upgrade Notice section to readme.txt
+
+= 1.1 =
+* Convert `&#8242;` and `&#8243;` back to single and double quotes, respectively
+* Add PHPDoc documentation
+* Update readme.txt changelog with info from earlier releases
+
+= 1.0.1 =
+* Now also filter widget_text
+* Note compatibility with WP 2.9+
+* Update readme.txt (including adding Changelog)
+
+= 1.0 =
+* Modify core code to consolidate multiple str_replace() calls into one
+* Change description
+* Add extended description, installation instructions, and compatibility note
+* Change from BSD license to GPL
+* Update copyright date and version to 1.0
+* Add readme.txt
+* Tested compatibility with WP 2.3.3 and 2.5
+
+= 0.91 =
+* Add missing untexturization of `&#8221;`
+
+= 0.9 =
+* Initial release
+
+
+== Upgrade Notice ==
+
+= 1.4.2 =
+Trivial update: noted compatibility through WP 3.3+
+
+= 1.4.1 =
+Trivial update: noted compatibility through WP 3.2+ and fixed link in description in readme.txt
+
+= 1.4 =
+Minor update: deprecated 'wpuntexturize()' in favor of 'c2c_wpuntexturize()'; renamed action from 'wpuntexturize' to 'c2c_wpuntexturize'; added link to plugin homepage in readme.txt
+
+= 1.3.2 =
+Trivial update: noted compatibility through WP 3.1+ and updated copyright date
+
+= 1.3.1 =
+Bugfix release. Fixed bugs preventing plugin activation.
+
+= 1.3 =
+Minor update: renamed a filter; added a filter; wrapped initialization into a function.
+
+= 1.2 =
+Highlights: now applies to all places in WordPress where quotes are made curly; can now programmatically control what filters are affected; verified WP 3.0 compatibility.
@@ -0,0 +1,96 @@
+<?php
+/**
+ * @package wpuntexturize
+ * @author Scott Reilly
+ * @version 1.4.2
+ */
+/*
+Plugin Name: wpuntexturize
+Version: 1.4.2
+Plugin URI: http://coffee2code.com/wp-plugins/wpuntexturize/
+Author: Scott Reilly
+Author URI: http://coffee2code.com/
+Description: Prevent WordPress from displaying single and double quotation marks as their curly alternatives.
+
+Compatible with WordPress 1.5+, 2.0+, 2.1+, 2.2+, 2.3+, 2.5+, 2.6+, 2.7+, 2.8+, 2.9+, 3.0+, 3.1+, 3.2+, 3.3+.
+
+=>> Read the accompanying readme.txt file for instructions and documentation.
+=>> Also, visit the plugin's homepage for additional information and updates.
+=>> Or visit: http://wordpress.org/extend/plugins/wpuntexturize/
+
+*/
+
+/*
+Copyright (c) 2004-2012 by Scott Reilly (aka coffee2code)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+
+if ( ! function_exists( 'c2c_wpuntexturize' ) ) :
+/**
+ * Prevent WordPress from displaying single and double quotation marks as
+ * their curly alternatives.
+ *
+ * Despite the unfortunately misleading name, this plugin is NOT the antithesis
+ * of WordPress's wptexturize() function. This ONLY prevents WordPress from
+ * making HTML entity code substitutions of single and double quotation marks
+ * with their curly alternatives and does NOT prevent wptexturize() from making
+ * any other character and string substitutions.
+ *
+ * @param string $text The text to have quotation characters reverted from HTML entities to plain-text
+ * @return string The converted text
+ */
+function c2c_wpuntexturize( $text ) {
+ $char_codes = array( '&#8216;', '&#8217;', '&#8220;', '&#8221;', '&#8242;', '&#8243;' );
+ $replacements = array( "'", "'", '"', '"', "'", '"' );
+ return str_replace( $char_codes, $replacements, $text );
+}
+add_action( 'c2c_wpuntexturize', 'c2c_wpuntexturize' );
+endif;
+
+
+if ( ! function_exists( 'c2c_init_wpuntexturize' ) ) :
+/**
+ * Initialize wpuntexturize, primarily to register it against filters
+ *
+ * @return void
+ */
+function c2c_init_wpuntexturize() {
+ $filters = (array) apply_filters( 'wpuntexturize_filters', array(
+ 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title',
+ 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description',
+ 'term_description', 'the_title', 'the_content', 'the_excerpt', 'comment_text', 'list_cats', 'widget_text' ) );
+ foreach( $filters as $filter )
+ add_filter( $filter, 'c2c_wpuntexturize', 11 );
+}
+endif;
+add_action( 'init', 'c2c_init_wpuntexturize' );
+
+
+if ( ! function_exists( 'wpuntexturize' ) ) :
+/**
+ * Prevent WordPress from displaying single and double quotation marks as
+ * their curly alternatives.
+ *
+ * @since 1.0
+ * @deprecated 1.4 Use c2c_wpuntexturize() instead
+ */
+function wpuntexturize( $text ) {
+ _deprecated_function( 'wpuntexturize', '1.4', 'c2c_wpuntexturize' );
+ return c2c_wpuntexturize( $text );
+}
+add_action( 'wpuntexturize', 'wpuntexturize' ); // Deprecated
+endif;
+
+?>

0 comments on commit 21e4092

Please sign in to comment.