The chances of me ever using the WordPress str QuickTag are pretty slim, so I replaced it with a drop-capper. (The T in this paragraph should appear as a dropcap for you if you’re using a browser that handles CSS properly.)

Pretty nifty, I think.

Want to do it?


NOTE: As of WordPress 2.04 the quicktags.js file has been moved to wp-includes/js/ and is no longer located in wp-admin!

Open the file wp-admin/quicktags.js and look for the lines that add the str quicktag. They look like this:

edButtons[edButtons.length] = 
new edButton('ed_strong'
,'str'
,'<str>'
,'</str>'
,'b'
);

Change them to this:

edButtons[edButtons.length] = 
new edButton('ed_dropcap'
,'DropCap'
,'<span class="dropcap">'
,'</span>'
,'b'
);

Then add this class to your stylesheet:

.dropcap{
	float: left;
	font: bold 250%/normal Verdana, Arial, sans-serif;
	margin-bottom: -5px;
}

I was going to create this as a my first real plug-in, but the the_content() function echos and doesn’t actually return an editable variable, so it got all tricky and I said screw it. If anyone knows of a way to get the_content() to return a variable, let me know and I’ll convert this to a plug-in. I’m afraid I am not quite yet a master of PHP, and I didn’t want to start screwing around with the core WP files that control the output of the_content(), so …