Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 359 of 427)

Hello Dolly – Episode 1: The Empire Strikes Back

A couple of weeks ago, my team and I published the first episode of Hello Dolly largely as an experiment to see if we had anything worthwhile to contribute to the podcast-space regarding WordPress.

In fact, the episode was such an experiment that we named it Episode 0.

But based on the feedback via comments, tweets, and emails, it was clear that you guys were interested in the podcast, and so we wanted to publish the first official podcast before the end of the year.

Today, we’ve done just that.

Continue reading

Three Things I’ve Learned From Blogging

One of the cool things about managing a blog that talks significantly about code is the feedback that I get based on certain code snippets I share.

Specifically, I enjoy getting comments that ask why I’ve chosen to do things a certain way versus another. Some of these examples include:

  • Why have I opted to use functions rather than constants?
  • Why have I chosen to use a custom query over encapsulating some built in functions?
  • …and so on.

I think that for most people who manage a blog, they hope that part of what they write is contributing something positive and helpful to the Internet (this isn’t always the case, for sure).

Similarly, I think that people who engage in discussion via thoughtful comments are looking to improve on the original content.

At the risk of committing a generalization, this seems to be the case in most programming blogs. While thinking about this, it did raise a question:

Continue reading

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 :)).

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑