Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Fuon FEElters

UPDETE 2008-09-22: Zees cude-a ves suoperceded by my Text FEElter Suoite pluogeen. Yuou cuon duonlued zee-a cuorrent fersiun ouff zee-a pluogeen frum zee-a VurdPress Pluogeen Durectury. Bork Bork Bork!

Updeted Ouct 4. FEExed cude-a tu nut cunfert sequoences inside-a zee-a regex ixemple-a intu smeelees. Updeted feele-a vit a pruperly furmetted REEDME. Bork Bork Bork!

I feenelly gut iruound tu imprufing und cleuoning up my blug feelters. Iff uny ouzeer ouzeer VurdPress users vuould leeke-a tu pley vit my hecks, I’m mekeeng zee-a cude-a ifeeleble-a:


Inside-a zee-a zip, yuou vill feend three-a text feeles:

Zee-a furst step is tu insert zee-a cuntents ouff fuon_ffeelters.php.txt it zee-a ind ouff yuour b2-incluodes/b2ffuonctiuns.php feele-a (buot beffure-a zee-a feenel ‘?>‘ leene-a)

Next, oupee-a up yuour b2-incluodes/b2fers.php feele-a und scrull duon tu zee-a buttum. Luok fur zees leene-a:

    idd_ffeelter('ill', 'vptextuorize-a');

Juost beffure zeet leene-a, insert zee-a cuntents ouff zee-a ectifete_ffeelters.php.txt feele-a. Vit zees cude-a in plece-a, yuour blug vill ouotumeticelly svitch oun zee-a purete-a feelter oun Telk LEEke-a a Purete-a Dey (September 19). Ilsu, uny ouff zee-a ouzeer feelters cuon be-a ictifeted by iddeeng ‘?feelter=feelterneme‘ tu zee-a ind ouff yuour URL (vhere-a feelterneme is oune-a ouff ‘purete‘, ‘cheff‘, ‘fuodd‘, ‘jeefe‘, our ‘kruot‘). Bork Bork Bork!

Zees sterted vhee-a I idded a purete-a feelter tu my blug fur Telk LEEke-a a Purete-a Dey. My furst fersiun ves iesier thuon I ixpected it tu be-a (thuough it hed flevs), vheech inspured me-a tu lucete-a und cunfert sume-a ouff Kelsey’s MufebleJEEfe-a feelters. Bork Bork Bork!

Zee-a beeggest flev in zee-a ierleest fersiun ves zeet it vuould feelter text inside-a ouff HTML tegs, cuosing it tu muongle-a leenks und suoch. I feexed zees by burruoing un idea frum Simun Villeesun. Simun’s use-a ouff a cellbeck fuonctiun tu ounly metch text zeet ves nut pert ouff a teg ves guod, buot it incluoded zee-a ‘>’ und ‘<‘ breckets frum suorruoundeeng tegs in zee-a metched text beeng suobstituoted, requouring yuou tu heck zeem beck in it zee-a ind ouff yuour cuntent feelter. Bork Bork Bork!

Effter un iffternuon stuodying zee-a pcre-a pettern syntex und vrestleeng regexes vit zee-a help ouff zee-a Regex Cuech I ceme-a up vit un imprufed pettern, vheech duesn’t requoure-a us tu teck zee-a ‘>’ und ‘<‘ beck oun muonuoelly. Cuol, huoh? Here-a’s zee-a regex pettern I ceme-a up vit: (?(?<=>)|\A)([^<>]+)(?(?=<)|\Z)

Und yes, I knuo, it’s nut perffect. Buot it shuould vurk oukey fur HTML zeet’s muderetely cleuon. Yuou’d prubebly hefe-a tu try herd tu buost it. It duesn’t ifee-a seem tu get cunffuosed iff yuou hefe-a ungle-a breckets inside-a ouff un ittribuote-a in a teg, ifee-a thuough I thuought it vuould. Bork Bork Bork!

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Plugins, WordPress and tagged , , , , , , , . Bookmark the permalink.

8 Responses to Fuon FEElters

  1. Pingback: geek ramblings » Text Filter Suite Plugin for WordPress

  2. MaThIbUs says:

    Evesume-a stuoff! Bork Bork Bork!

  3. logtar says:

    Duode-a, I im su gled I fuound yuour site-a… reelly cuol stuoff.:mrgree-a:

  4. Craig says:


    Uny thuoughts oun updeting zees fur VP 1.2+ ? I’d teke-a a steb it it, buot, uh, vell…yuou knuo. Bork Bork Bork!

  5. Pingback: Jean-Philippe Leboeuf Notebook

  6. Frank says:

    Vill zees vurk fur VP 2.6? Zee-a duonlued leenk is deed. Bork Bork Bork!

  7. Pingback: Mind Blowing WordPress Plugins « Lorelle on WordPress

  8. Pingback: Odds and Ends WordPress Plugins You Must Know About « Lorelle on WordPress

Leave a Reply

%d bloggers like this: