Resetting $post in WordPress admin

I have run into a bug a few times in the past little while that had me stumped. When creating meta boxes on the admin side of WordPress that contained custom loops, I couldn’t reset $post using wp_reset_postdata() – it just didn’t work.

Originally, I thought maybe I was doing it wrong because I was using get_posts, so I tried WP_Query with the same results. So, thinking I had a legitimate bug, I went to report it and found that there was already a ticket and a patch for it ( gotta love the WordPress community ). The patch is a nice, elegant fix that worked well when I tested it – but until it’s accepted into core it’s not really an option to use because hacking core is bad. So I rolled my own in the meantime. Continue reading Resetting $post in WordPress admin

Change the WordPress post updated messages

Sometimes it is necessary to modify or remove the default WordPress post updated messages that are displayed when making changes to a Post in WordPress. One example is when you are creating a custom post type that does not have a permalink. When you save a draft, publish or update a published post, you are presented with messaging that includes a link to the post – which in that case will take the user to a 404 page. Continue reading Change the WordPress post updated messages

Custom post types with no permalinks

When I was at WordCamp Ottawa this year, I was asked a question about how to create custom post types without generating permalinks. This is actually something I do a lot of as I am creating internal content types that are not meant to be viewed individually at their own url.

The snippet below will register the post type and you’ll notice that there is no Permalink line below the title. Continue reading Custom post types with no permalinks

Debug Bar Tracer Plugin

I have just released a new plugin called Debug Bar Tracer. It is meant to work with the Debug Bar plugin that should be a staple of any WordPress developer’s toolkit. The idea behind it is quite simple – I am always printing data out to the browser when developing and it always breaks the page and looks horrible. This plugin just adds a new panel that will show you the location of the call ( complete with file name and line number ) as well as the data you are sending out.

Please take a look and let me know what you think!

 

Creating a skinnable WordPress widget

Building custom widgets is fun, rebuilding them because we need to change the way it looks is not. With that in mind, lets build a skinnable WordPress widget that separates how it looks from what it does. For the purposes of this tutorial, I am assuming that you are comfortable creating a Widget and working with the API. Please refer to the Widget API as needed. Continue reading Creating a skinnable WordPress widget

Bye bye ActionScript

So I’ve decided to retire the Action Script section of my website. I don’t really work with Flash all that much anymore and to be honest, I’m getting quite rusty at it. The posts will still be available but I won’t be adding anymore moving forward.

Dreamweaver Command – French Characters

I recently developed a Dreamweaver command to automate a process I hate to do manually – turn French characters into their HTML entities. It’s pretty straight forward, highlight the copy you want to scan, select French Characters under the Commands menu and follow the prompts.

To install, unzip the files and drop them into your Commands folder.

I wrote it for CS5 but have since tested it in CS6 and it works.