JaJah - Call Us!

This is my hack page for Wordpress Plugins I had to write because I couldn’t find a quick solution online.

These Are hacks, dirty, unreliable, probably not compatible with the next release or update, and sometimes always behave erratic.


Update-Image-Title-From-Library

This is for Wordpress 2.5RC1.

Before displaying a post, the title and alt attributes of the <A> and <IMG> tags are altered: The images are looked-up in the media library of WordPress 2.5 the title attribute of <A> will become the extended description of the image in the media library; the title attribute of <IMG> will become the title of the image, and the alt attribute of <IMG> will become the description of the image in the library.

The same applies for the pre-edit event, when all code within tinyMCE will be updated accordingly.

I’m also replacing all double quotes in title and alt texts with single quotes, as I am not sure how my simple search’n'replace would handle it otherwise…

DOWNLOAD

What’s not working / needs work:

  • This script runs nine regular expression search’n'replaces on each blog post for each image in it. It’s a waste. it will slow down your loading times.
  • There is no configuration or options page. I don’t think this script will live long, so I didn’t bother.
  • I’m sure the regular expression I hacked together will break sooner or later on a file name I create. So be it, I’ll fix it then.
  • messing with tinyMCE is fun, and I’m sure it will break sooner or later.