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…

Read more...

WordPress Plugins and debug mode

Sometimes when we’re developing a plug-in, it’s easy to forget that we’re not building something that is meant to be standalone. What we’re building is going to exist as part of the WordPress ecosystem and as such it should respect it’s configuration. Simply put, if WordPress is in debug mode, than your plugin should be…

Read more...

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…

Read more...

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…

Read more...
Clef two-factor authentication