WordPress: Adding “Get Shortlink” to Custom Post Types

For some reason, by default, WordPress only includes the “Get Shortlink” button when editing posts; not when editing any kind of custom post type or when editing pages. Honestly, I’m not sure why, since pages and custom post types all use the same basic short URL as standard posts (example.com/?p=[post_id]).

The solution is simple, though. You just need to hook into the get_shortlink filter. Following is a simple function that will help you add the button to all “publicly_queryable” post types in your theme.

Organize Your Gmail Messages

A while back, I decided to start setting up some filters in one of my Gmail-based accounts to help organize my messages. I was accustomed to the way filters and rules work in traditional e-mail systems, so I was surprised to find out that I still received copies of the messages in my Inbox, as well as the folder (label) I’d set up.

I can completely understand the value of a setup like that, but it wasn’t what I’d wanted at the time. I wanted the e-mail messages to be delivered into just the folder I’d set up, without copies of those messages cluttering up my Inbox.

After a bit of help from friends on Friendfeed and Twitter, I figured out how to stop the copies from arriving in my Inbox. It’s pretty simple, really; and I’m not sure why I didn’t notice it when I was first setting up the filters.