devinsays/portfolio-post-type — pull request #18 by GaryJones (2013-08-25 22:13:12+00:00)
Title: Make the code a little more DRY

Pulls the array of taxonomy slugs out of a couple of methods into its own method. Sticks with the order of category before tag. Not only is this alphabetical, but it's the same order as Post taxonomies are displayed in the admin menu. As such, the order within portfolio_init() has been changed as well. While functionally the same, someone using muscle memory might click on the wrong link by mistake. Since the correct action is one step away, and it brings the Portfolio and Post taxonomies into parity, I don't consider this a reason to not go ahead with this.

The only related step to this not done (as it would almost certainly conflict with #17) is to re-order the taxonomy registration functions so that the category one came before the taxonomy one.

In add_thumbnail_column(), there's no need to assign a value to a variable then return the variable - just return the value instead.

The add_portfolio_counts() method has been refactored to pull out two smaller helper functions to reduce the obvious duplication between showing number and label for published portfolio items and showing number and label for pending portfolio items. It would be possible to refactor it further into one function that handles this setup and display, but that can be done on a second round.

Finally, the plugin_dir_url( __FILE__ ) isn't going to change, so instead of calling it twice, call it once, assign to a variable, and use that variable twice instead.