[wp-hackers] Help review small caps plugin

Stephen Rider wp-hackers at striderweb.com
Sat Aug 2 02:23:46 GMT 2008


On Aug 1, 2008, at 3:17 PM, Chetan Kunte wrote:

> I wrote a simple and tiny plugin to enclose all existing (and future)
> capitalized words within abbr tags, so I could style it to, say, small
> caps---for typographical effect.

Neat! :)

> 2. Does the blog take a performance hit when you add_filter to
> the_content, i.e., is this the best way of implementing it?

This is probably the best way to do it.  The other option is pretty  
much to alter the actual content as it's saved to the DB.  Stick with  
a filter so it can be undone.

> 3. What is the simplest way of adding a custom CSS call to the <head>
> section, say, a styling to abbr, so the user need not have to add
> styling to every theme activated?

add_action( 'wp_head', 'myplugin_wp_head' );

function myplugin_wp_head () {
	echo "\n<style type=\"text/css\">abbr{color:mauve;}</style>\n";
}

Pretty simple. ;-)

Regards,

Stephen

-- 
Stephen Rider
<http://striderweb.com/>





More information about the wp-hackers mailing list