Software Engineering in Web Development, Backend Services, and More

Author: Tom (Page 362 of 430)

Quick Tip: Handle When save_post Is Called Twice

If you're an experienced developer, you may wish to skip to the code.

If you’ve ever done any work with building a plugin or building a feature of a theme that includes a custom meta box or that includes functionality that is fired on the save_post action, then you’ve likely seen WordPress save_post called twice.

The thing is, this is expected behavior, but because of how it’s used, you may not always want your code to execute until the user actually clicks on the save button.

So here’s a quick tip on how to properly manage the case when save_post is called twice.

Continue reading

How To Find The Permalink By Slug in WordPress

If you're an advanced developer, then you may want to skip directly to the code.

As soon as you begin working on an advanced plugin or an application in which you try to maintain some form of solid cohesion (or even an API), then you end finding that there’s a function you need that isn’t available in the Codex.

This isn’t unique to WordPress. Any programming language that has a rich API ultimately has a set of solid features that allow you to build upon them to write more power functions.

For me, I try to publish most of my helper functions here on the site. It makes things searchable, available, and even available for code review for the more critical readers :).

Case in point: In a recent project, I needed to find the permalink by slug in WordPress and there wasn’t a function available to do exactly that, so here’s what I ended up doing.

Continue reading

Merry Christmas!

Merry Christmas 2012

Today, my family and I – and all of the in-laws on both sides – are celebrating Christmas, so we’re spending time exchanging gifts, hanging out, eating, and enjoying the time with each other.

Whatever you’re celebrating today – even if it’s nothing at all – I hope you guys are having an awesome time, as well.

I’m looking forward to bringing in 2013 with as much good stuff as possible and hope you are, as well. I’ll be back to the regular content tomorrow.

Merry Christmas and to all a good night (or good morning or whatever time it is where you are or when you read this :)).

The Inaugural Video Blog – Discussing WordPress: A Post Mortem

One of the best things about doing any type of experiment is that you’re not necessarily committed to following through on anything beyond seeing if the idea has any value.

Last week, I asked – in awkwardness and all – if there was any reason or interest in discussing WordPress development via a series of video blog posts. Overall, the response between the comments and via Twitter was nearly 50/50.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑