Celebrating 10 years of Development in WordPress

Happy Anniversary to me. This year I’m celebrating 10 full years of working in WordPress.

The first project I remember well. I was working for an agency out of Washington D.C. At the time the CMS we were using was based on an old version of MoveableType. For client projects we had this multi-tabbed Excel spreadsheet to estimations. Adding any custom type of functionality like an archive page or even RSS was a total pain and hence we can up-charge the client.

Generally when you work in an agency it is all about billable hors. In my case the developers we expected to give detailed estimates on each client project. Using the PERL-based MT system this was for me a shot in the dark sometimes. You may quote 5 hours to add RSS feed or an archive page. Sometimes you hit that mark. But most times you didn’t. This can create a lot of tension in development teams because you are judged by the management on how well you can give close estimated and then meet those estimations.

Frustrated with using the MT system I decided there had to be an easier method. So over that long weekend I took an existing and finished MT project and decided to see how it would be built using WordPress. Up to that point, I had not used or touched WordPress. I knew PHP, HTML, CSS, JavaSscript, etc. My only exposure from was an internal presentation from another developer. And at the time I thought it looked promising. Much better about publishing dynamic content. Remember at the time MT and many other CMS type systems simply generated the final HTML output when they went through the publishing cycle. WordPress on the other had was a dynamic engine.

Building the WordPress replacement of the site was in a word amazing. Even back then using WordPress pre-1.5 you could do a lot of things via the theme itself. And for the needed of the project I already had the layout via the complete HTML. So was just a matter to carving out the header and footer sections. The sidebar then the main content after. Then the really cool understanding that I didn’t need to create a completely new output template for each page. Wow. I only have to create the general index.php and single.php. Links and RSS were all built-in and automatic.

So after the three days of the weekend I had a finished theme. Complete with the real imported data!

So you may be asking how long the same functionality took to developer using MT? Well I remember the project taking 6 weeks. But realize that was partly client delays (always). Design time. And a team of 2-3 developers to setup hosting, cutup PSD from design. Reviews and tweaks for browsers. etc. So lets say 10 days to 2 weeks for actual development into the MT system. So in effect I had done the same thing in three days. That meant instead of tying up a team of developers, designers, account people on a project for 6 weeks. It could instead be a mere 10 days or less if you get really good about reusing some of the theme parts.

Over the next year I was the WordPress go to guy. I was up to pushing out a site every two weeks. It would have been quicker but you have to allow time for client reviews and changes. But not too many changes.

Since that first years I moved into plugin development to add our own custom functionality.

A New Year, a new you, a new coat of paint on the old website

Testing…TESTING! Is this thing (still) on? Why yes it is. I know there has been exaggerated reports of my demise. I’m still here. Still kicking. Still coding.

I’ve decided to start off 2015 with a fresh design for the site. And maybe get back into writing about some of the cool projects I’ve been working on for the past few years. The new look is based on the WordPress Free Theme Flat. I’ve added some tweaks of my own to a child theme. More functionality to come over the next few weeks.

So where have I been? What have I been doing with my time? Over the past few years I’ve gone deep into WordPress plugin development. I was working for a major WordPress plugin vendor (not going to name them here but you can check out my LinkedIn profile if you are curious). During my tenor there I was responsible for development and supported for up to 26 plugins. I learned so much about how to write plugins to work across the wide range of hosting environments. How to be efficient with coding and how to get along with site running many dozen other plugins. I learned some valuable knowledge about WordPress Multisite as well as BuddyPress. So really want to bring that back to my own plugins.

Speaking of my own plugin. I’m in the process of rewriting parts of my Media-Tags WordPress plugin to work better within the new Backbone.js Media system used with WordPress. Lots of good changes coming soon.

In other WordPress directions I’ve fallen in love with WooCommerce. Thinking back to the early days of WordPress commerce engines (again not going to name names). I can remember having to literally hack the plugin to get things to work per the client needs. And hoping the client never ever upgraded. With the new WooCommerce 2.x it feels more like BuddyPress. Lots of way to override even the smaller elements. Not to mention tons of template files you can add to the theme to override the default action. There is one area I tend to dislike related to Variable Products managements. I’m working on an add-on of my own. Hope to announce it soon.

Besides my fallback WordPress projects, I’ve been working some in Swift, the new Apple language. As many have stated it does remind one of JavaScript in some of the syntax. But yet it is very powerful for creating apps. Speaking of JavaScript I’ve also been playing with Node.js. I’m very very excited about the potential there. First thing I thought of when playing with the modules is “someone ought to write a CMS in Node.js”. Well a few have started. The most promising is PencilBlue. They actually state in the documentation they want to replace WordPress. Lofty goal. I’ll need to find some time and join the development group. See if I can bring in some of my WordPress knowledge.

Other than coding related things. We are still discovering parts of North Carolina. Still have not made the road trip to Asheville. We both miss Texas and especially our friends in Austin. I miss all the friends and contacts from the Refresh Austin and WordPress Austin groups. As well as SXSW Interactive being in my backyard. I’ve tried getting into the local WordPress group as well as other groups in the Triangle. They just seem a little too cliche-ish to me. I’ll try again this year.

On a personal note we moved into a beautiful home last year. The new neighborhood is great as well as the neighbors who actually come over and visit. Unlike the previous neighborhood where we were renting. The neighbors just could not be bothered to say hello to you. We even have a neighborhood book club I joined last year. I’m the only male in the group and was apprehensive. I thought I would be getting into some Harlequin Romance and Jane Austen type reads. But we have read some very interesting books. So I’m looking forward to some nice reading outside of my own tracks this new year.

Well that is about all for the update. I hope to be posting regular. I already have some other posts in the queue I’ve worked on. Just need to polish and publish.

Adding Custom Columns to WordPress Post listing

In a reader comment one of my previous posts about “Adding columns to Taxonomy tables”. The commenter asks how to add columns to a normal Posts listing.

Well, readers here is the simple solutions. There are basically 2 hooks. One is a filter. The other an action. Below are examples of how to setup these hooks. I explain the details below the code listing.

So what are these filters/actions function?

The first line, add_filter( ‘manage_edit-post_columns’… sets up a filter. This filter adds the new column to the listing. This filter is called only once when the page is loaded. Since this is a Filter WordPress will call our function ‘admin_post_header_columns’ and pass in a parameter. In this case the parameter is an array of columns. As part of our function we can change/add/delete items from the array then we MUST return the array. In our simple example all we are doing is adding an item to the array for our ‘Notes’ columns. As with any PHP array we assign a key to be ‘note’ and the column label ‘Notes’. Then return the array back to WP.

A note about the filter name. Notice we setup the filter as using the first parameter ‘manage_edit-post_columns’. Keep in mind this filter is specific to Posts. If you wanted to do this same thing for Pages you would instead use ‘manage_pages_columns’. Or if you were using a custom post type the value would be ‘manage_{$post_type}_posts_columns’ where ‘{$post_type}’ is your post_type. For example if we register a new post_type Products with the key ‘products’ then the filter would use the parameter of ‘manage_products_posts_columns’. On to the second hook. The action.

The second line of our code registers an action. While the previous filter added the column to the listing. This action gets called for each row of the displayed posts to display the contents in the row cell for that column. In WordPress an action is different than a filter in that your function may be passed some optional parameters but you are not expected to return any values. For our purpose we setup an action to the hook ‘manage_posts_custom_column’ which will call our function ‘admin_post_data_row’.

Inside our function we setup a case statement to switch on the column name. In our instance we only want to effect the ‘note’ column. This ‘note’ value is the array ‘key’ we defined in our previous filter function.

Back to the action hook registration. Notice the third and fourth parameters on this action registration call. The third parameter tells WordPress the priority of this hook o when to process it in relation to other hooks. A lower number means sooner a higher number means later. We set this to ’10’ which is a default value. The fourth parameter tells WordPress how many arguments to pass to our function. By default there will be only one argument, the column name. But since each row (post item) will have different values we need the second parameter which in this case is the ID of the post so we can look up the related custom field.

Also, like the filter hook where we setup the column there are different filters to call based on if you are using this on Pages, Posts or some custom post_type. In our case we are adding the column to the Posts listing so the first parameter of our hook is ‘manage_posts_custom_column’. If we were adding a column to Pages the parameter would instead be ‘manage_pages_custom_column’. And if we were adding this column to a custom post_type the parameter would be ‘manage_{$post->post_type}_posts_custom_column’ where ‘{$post->post_type}’ is the key to our registered post_type.

I hope this helps with a deeper understanding of WordPress and an appreciation of the wonderful world of WordPress actions and filters.

Pages-Children 1.5 released

Over the last week I’ve released 3 versions of my popular Pages-Children plugin.

Here is a breakdown of the changes.

1.3.1 – Fixed issues is plugin which were effecting the Media Library listing. As far as I can tell this was related to the update in WordPress 3.1.3

1.4 – Added support for any hierarchical post type. Previous versions of the plugin only worked for the default Pages. Now if you have any custom post type defined hierarchical you can have better formatting of the output.

1. 5 – In the previous version (1.4) I added support for custom post types. In this latest version I’ve added support for hierarchical taxonomies as well. Here is an example of a terms listing showing the breadcrumbs and navigation to ‘children’.

To comment or report an issue regarding this plugin please see the main project page for Pages-Children

Out of 1000 WordPress plugin developers I’m now ranked 372!

Thanks to W-Shadow for putting together this nice page, http://w-shadow.com/files/top-1000-plugin-authors.html.

The page appears to be a mashup (do people still use that term) taken form wordpress.org plugin repository. The ranking on the page appears to be based on plugin downloads. Still out of 1000 plugin authors it’s nice to be in the top half. Though would be grateful to placement anywhere on the list. Thanks W-Shadow.