J. Michael Ambrosio's musings on web development and programming.

Simplify WordPress Editing Screens Using remove_post_type_support

WordPress 3.0 introduced several new functions for managing custom post types. One of these functions is the poorly documented remove_post_type_support:

remove_post_type_support( $post_type, $feature )

At first glance, this function seems rather useless, since you can easily define the list of features that a custom post type supports when you first register it using register_post_type. But here’s something interesting I discovered recently while building a WordPress site for one of my clients [...]

Seeking Beta Testers for Next/Previous Post Link Plus 2.0

I am currently seeking beta testers for version 2.0 of my Next/Previous Post Link Plus plugin for WordPress. I have made significant changes in this version to add some new features that were requested by users of the plugin. [...]

Clean Up WordPress Revisions Using a MySQL Multi-Table Delete

I’ve been doing some research on the revisions WordPress creates automatically whenever you edit or update a post. The revision feature is sparsely documented in the WordPress Codex, so I was pleased to find an article from SitePoint on the subject: How to Control Post Revisions in WordPress. It’s an excellent write-up overall, and I recommend reading it. However, I did notice a flaw in the SQL statement given for deleting old revisions. Since this flaw could potentially cause unintended data loss, and since comments on the article are closed, I wanted to explain the problem here. [...]

Truncate Long Titles to the Nearest Whole Word Using PHP strrpos

I ran into what must be a common problem while coding a WordPress plugin the other day, and I had a surprisingly difficult time finding a satisfactory answer: Is there a way to truncate long titles to the nearest whole word, without cutting off any part of a word? [...]

It’s Official: WordPress is Not Just a Blog Any More

Here’s an interesting bit of news for those who have spent the last few years debating whether WordPress is a CMS: as of 03:17 on April 30, 2010, WordPress is officially no longer just a blogging platform. That is the timestamp on Changeset 14315, checked into the core by WordPress contributing developer and core committer Andrew Nacin. As of Changeset 14315, most instances of the phrase “WordPress blog” are gone from the core source files [...]

Shorten Category Names in WordPress Dropdown Menus

An interesting problem was raised on the WordPress support forums recently: Is there any way to shorten category names in dropdown menus so they don’t scroll off the side of the screen?

Here’s an example of what I mean. Suppose you have a movie blog where you are using movie titles as categories. You want to put a dropdown menu in the sidebar using the Categories widget, so your readers can easily browse to any particular movie that interests them. It all sounds good in theory, except that some movies have really long titles that make the dropdown list too wide to fit into the sidebar [...]

Hide Phone Numbers From Skype Using the HTML Soft Hyphen

I ran into an annoying problem while updating my web site recently. I have Skype installed and running on my Windows desktop. Skype is a great application; I use it all the time, and I recommend it to others. However, while testing my site in Internet Explorer, I noticed something I had never seen before (probably because I never use IE for my personal web browsing): Skype added some unwanted link formatting to the phone number in my site header [...]