Changeset 146309
- Timestamp:
- 08/16/2009 08:56:57 AM (17 years ago)
- Location:
- acronyms/trunk
- Files:
-
- 2 edited
-
acronyms.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acronyms/trunk/acronyms.php
r92954 r146309 4 4 Plugin URI: http://ketsugi.com/software/wordpress/acronyms-plugin/ 5 5 Description: A plugin to wrap acronyms in posts and comments with appropriate <acronym> acronyms. Allows users to manage lists of acronyms through admin interface. Based on Joel Bennett's Acronym Replacer plugin (http://www.huddledmasses.org/) and Joel Pan's NP_Acronym plugin for Nucleus CMS. 6 Version: 1.6. 16 Version: 1.6.2 7 7 Author: Joel Pan 8 8 Author URI: http://ketsugi.com/ … … 33 33 function install () 34 34 { 35 echo "BOOYAH"; 35 36 // Populate defaults 36 37 $acronyms = array( … … 170 171 ); 171 172 add_option( 'acronym_acronyms', $acronyms ); 172 173 // Add default options -- Options not currently modifiable by user174 add_option( 'acronym_content', 1 );175 add_option( 'acronym_comments', 1 );176 173 } 177 174 … … 190 187 { 191 188 // Perhaps I should remove the acronyms when uninstalling to clear out the cruft? But what if the user is just temporarily deactivating the plugin with the intention to activate it again later, and doesn't want to lose all his/her custom acronyms? 189 echo "BOOYAH"; 192 190 } 193 191 … … 375 373 $text = " $text "; 376 374 foreach ( $acronyms as $acronym => $fulltext ) 377 $text = preg_replace( "|(?!<[^<>]*?)(? <![?.&])\b$acronym\b(?!:)(?![^<>]*?>)|msU", "<acronym title=\"$fulltext\">$acronym</acronym>" , $text );375 $text = preg_replace( "|(?!<[^<>]*?)(?!\[[^\[\]]*?)(?<![?.&])\b$acronym\b(?!:)(?![^\[\]]*?\])(?![^<>]*?>)|msU", "<acronym title=\"$fulltext\">$acronym</acronym>" , $text ); 378 376 $text = trim($text); 379 return $text; 377 //return $text; 378 return "BOOYAH"; 380 379 } 381 380 … … 611 610 register_activation_hook( __FILE__, array( 'Acronyms', 'install' ) ); 612 611 //register_deactivation_hook( __FILE__, array( 'Acronyms', 'uninstall' ) ); 613 if (1 == get_option( 'acronym_content' ) ) 614 add_filter( 'the_content', array( 'Acronyms', 'acronym_replace' ) ); 615 if (1 == get_option( 'acronym_comments' ) ) 616 add_filter( 'comment_text', array( 'Acronyms', 'acronym_replace' ) ); 612 add_filter( 'the_content', array( 'Acronyms', 'acronym_replace' ) ); 613 add_filter( 'comment_text', array( 'Acronyms', 'acronym_replace' ) ); 617 614 add_action( 'admin_menu', array( 'Acronyms', 'add_pages' ) ); 618 615 ?> -
acronyms/trunk/readme.txt
r92951 r146309 1 1 === Acronyms === 2 2 Contributors: ketsugi 3 Donate link: http://ketsugi.com/paypal_donate.php?plugin=WordPress%20-%20Acronyms%20Plugin4 3 Tags: acronym, post, formatting 5 4 Requires at least: 2.7 6 Tested up to: 2. 77 Stable tag: 1.6. 15 Tested up to: 2.8.4 6 Stable tag: 1.6.2 8 7 9 8 A plugin to wrap acronyms in posts and comments with appropriate `<acronym>` acronyms. Allows users to manage lists of acronyms through admin interface. Based on Joel Bennett's Acronym Replacer plugin (http://www.huddledmasses.org/) and Joel Pan's NP_Acronym plugin for Nucleus CMS. … … 33 32 == Change Log == 34 33 34 * 1.6.2 - 16 Aug 2009 35 * [FIX] Fixed a bug that replaced acronyms inside BBCode, breaking the output HTML 35 36 * 1.6.1 - 9 Feb 2009 36 37 * [FIX] Fixed the same bug... again...
Note: See TracChangeset
for help on using the changeset viewer.