An Update To The Filter Post Formats Plugin

An Update To The Filter Post Formats Plugin

I recently pushed an update to my Filter Post Formats WordPress plugin.  The plugin is simple and does not require a lot of updates to features unless the WordPress core changes.  This all started after recently switching my theme, then I noticed a small bug within the plugin.

Existing post formats exist

They really do.  I originally developed the plugin using a theme with post format support.  It worked and did what I wanted it to do.  Months later after switching to a theme without post format support, the plugin options disappeared.  Initially, I was a bit baffled.  Why was the plugin not working?  I had existing post formats.  I even imported the WordPress Theme Unit Test and still could not get it to work.  What gives!?

With a little detective work, I realized the logic I had set prevented the plugin from working if a theme did not have post format support.  This removed the ability to filter existing post formats.  I had not consider that existing post formats… exist.

By removing the requirement for post format support, a user can still use the plugin to manage existing post formats even if the current theme does not support post formats.  In the end, this opens the flexibility of the plugin.

Lesson learned.

Cleaning up the code

I have been programming for almost 7 years.  Programming is a constant learning process.  Every programmer will look back at code and think, “What is the hell was I doing?”.  This is good.  It means you have grown as a programmer.  I decided to put time aside to update the code.

Applying filters

I am a strong supporter for not editing the WordPress core or plugins.  Filters and Actions allow a developer to avoid editing core files.  This is makes WordPress great.  I absolutely love when a plugin I use allows the developer to extend or change the default functionality.  This adds value to the plugin.

I decided to add value by adding filters.  The documentation can be found on the Filter Post Formats project page.  I hope this will allow users to extend the plugin to serve them better.

Published by

rfmeier

Product developer at WPEngine and runner from Hampshire, Illinois. I work with php a lot; Spending most of my time digging into source code to see how it all works. You can find me on Twitter @rfmeier.

Leave a Reply

Your email address will not be published. Required fields are marked *