I’m happy to announce the first (slight) update to my timeline plugin for WordPress.

Download View Project

The update is actually just an improvement on the icon selection. I was using the Chosen plugin, which has some limitations. I’ve decided to go instead with Select2, which has a few improvements.

Here’s a demo:

The first thing I noticed with Chosen was that it only matched on the start of a word. (That’s not ideal.) There is an option you can specify to enable the behavior, but Select2 enables it by default.

Another issue was that due to how the select list appears (via position: absolute) and how the meta box is at the bottom of the screen, the select list would often get cut off or disappear altogether. When I was trying to figure out how to modify Chosen to get around this, I found the Select2 accounts for it automatically. When there’s not enough room to display the list below the select element, it moves the list above it. No extra code needed.

Check it out:

Lastly, Select2 seems to have a little more documentation and activity from the developers. When I use other people’s projects in my projects, I do prefer them to be active.

Another change I’ve made to the plugin is how the CSS and JavaScript are loaded. Now it’s using the WordPress methods to properly enqueue the files, instead of inserting the tag where it writes the meta box.

This post is part of the timeline: Timelines Plugin – an ongoing story on this site. View the timeline for more context on this post.