They took my title away!

Update: I managed to work out a solution for this. See this later post.

No, I haven’t had some honour that I never had removed, that would be silly. And I haven’t been cast out of the House of Lords, never having been a member, strange as that may seem.[1] No, what I’m talking about is the Title attribute of the images I post here with monotonous regularity every day[2].

You might recall from my series of EXIF tales that I’d spent quite a lot of time tweaking some code to get the titles created in Lightroom to populate all the relevant boxes when I upload the images to WordPress. This all worked nicely, but after the upgrade to WordPress 3.5, I began to notice that the titles were going away. They were there in the media thingy, but images inserted into posts had lost the title attribute.

So what’s the problem with that? Well, the first thing is that most browsers put the contents of the title attribute in the tooltip thingy that you see when your mouse hovers over the image. Losing that wouldn’t be a big deal, really, but I found that in a rather random way, the title of the post was showing up when hovering over images, which looked a wee bit wrong. Now this might have been related to the problem I was having with a lightbox plugin, but it was still annoying.

A bit of searching explained all. For reasons that make sense to some people (but not to me), from WordPress 3.5 onward, the title attribute is not inserted when an image is added to a post. If you want the title attribute, then after inserting your image, you have to click the image edit button, then either type in a title, or copy and paste the alt or caption attributes into the title box:



This is a wee bit of extra work for every image I insert, which is mildly annoying. I’ve started investigating ways of automating this – it should be a relatively simple bit of programming, but it’ll probably take me a while to get my head around it. A quick and dirty method would be to edit the actual core WordPress files, but I agree with the general advice that doing that is not a Good Thing. It should be plugin territory, and with any luck someone more code-oriented than I am will do the work first.

Update 2: I couldn’t wait, so created the plugin myself.

WordPress Trac Ticket on the subject

WordPress Support Topic

[1] Or not
[2] Except when I don’t

3 thoughts on “They took my title away!

  1. Pingback: Another little fix | Losing it

  2. Pingback: My Title Has Been Restored | Losing it

  3. Pingback: Restore Image Title – A WordPress Plugin | Losing it

Comments are closed.