Plugin Directory

Text Replace

Version: 3.2.2 Replace text with other text. Handy for creating shortcuts to common, lengthy, or frequently changing text/HTML, or for smilies.

Download Version 3.2.2

Replace text with other text. Handy for creating shortcuts to common, lengthy, or frequently changing text/HTML, or for smilies.

This plugin can be utilized to make shortcuts for frequently typed text, but keep these things in mind:

  • Your best bet with defining shortcuts is to define something that would never otherwise appear in your text. For instance, bookend the shortcut with colons:
:wp: => <a href='http://wordpress.org'>WordPress</a>
:aol: => <a href='http://www.aol.com'>America Online, Inc.</a>

Otherwise, you risk proper but undesired replacements:

Hi => Hello

Would have the effect of changing "His majesty" to "Hellos majesty".

  • List the more specific matches early, to avoid stomping on another of your shortcuts. For example, if you have both
:p

and :pout: as shortcuts, put :pout: first, otherwise, the :p will match against all the :pout: in your text.

  • If you intend to use this plugin to handle smilies, you should probably disable WordPress's default smilie handler.

  • This plugin is set to filter the_content, the_excerpt, widget_text, and optionally, get_comment_text and get_comment_excerpt. the filter 'c2c_text_replace_filters' can be used to add or modify the list of filters affected.

  • SPECIAL CONSIDERATION: Be aware that the shortcut text that you use in your posts will be stored that way in the database (naturally). While calls to display the posts will see the filtered, text replaced version, anything that operates directly on the database will not see the expanded replacement text. So if you only ever referred to "America Online" as ":aol:" (where ":aol:" => "America Online"), visitors to your site will see the linked, expanded text due to the text replace, but a database search would never turn up a match for "America Online".

  • However, a benefit of the replacement text not being saved to the database and instead evaluated when the data is being loaded into a web page is that if the replacement text is modified, all pages making use of the shortcut will henceforth use the updated replacement text.

Links: Plugin Homepage | Plugin Directory Page | Author Homepage

Author: coffee2code

Requires: 3.1 or higher
Compatible up to: 3.3.1
Last Updated: 2012-1-31 Downloads: 12,414

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(12 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1
100,1,1 100,1,1
0,1,0 100,1,1
100,2,2
100,1,1
100,1,1
100,1,1 40,5,2
0,2,0
0,1,0