Categories
Package/plugin/module WordPress

Text Replace v2.5

I’d like to announce the official release of the updated Text Replace plugin (v2.5) for WordPress.

Replace text with other text in posts, pages, etc. Very handy to create shortcuts to commonly-typed and/or lengthy text/HTML, or for smilies.

The plugin’s official homepage is located at :
coffee2code.com/wp-plugins/text-replace.

This release primarily makes available a number of tweaks and compatibility fixes to ensure support through WordPress v2.8+. Support has been dropped for versions of WordPress older than v2.6.

Comments welcome on this post for this version of the plugin. Comments will be closed once this release has been superseded by another.

Read more for a detailed ChangeLog of the release.

Detailed ChangeLog

These are the detailed changes, which may or may not make sense to you depending on your familiarity with the previous features and internals of the plugin.

  • Fixed path-related issue for options page
  • Added ‘Settings’ link for plugin on admin Plugins page
  • Changed permission check
  • More localization-related work
  • Minor code reformatting (spacing)
  • Removed hardcoded path
  • Updated copyright date
  • Noted compatibility through 2.8+
  • Dropped compatibility with versions of WP older than 2.6
  • Updated screenshot

9 replies on “Text Replace v2.5”

The plugin used to be able to do that, but depending on the type of replacements some people wanted to do, it could mangle some markup. However, I did leave that code commented out in the plugin, so it’s still around. Willing to try it out? I may introduce it back in as an optional alternative implementation, so let me know how it goes.

This is the bit of code from the plugin *after* having been changed to work. Basically you’ll remove the “//” that precedes the line after “// Old method…”. Then comment out the next two lines of code (using “/*” and “*/”) as I’ve done. You should be able to change links, etc, contained within tags (but be more mindful of the replacements you define).


        // Old method for string replacement.
        $text = preg_replace("|([\s\>]*)(".$old_text.")([\s\<\.,;:\\/\-]*)|imsU" , "$1".$new_text."$3", $text);
        // New method.  WILL match string within string, but WON'T match within tags
/*        $preg_flags = ($case_sensitive) ? 's' : 'si';
        $text = preg_replace("|(?!<.*?)$old_text(?![^<>]*?>)|$preg_flags", $new_text, $text);
*/

i would like to use a php form to convert several bits of form data in to a script which would then automatically be inserted into the text replace database, but i am not sure where the text replace information is stored….