Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 119 of 427

Using the PHP Interpreter When Working With WordPress

Recently, I’ve been working on a project that requires a lot of work with dates. Depending on the nature of the work, there are times in which this can be easier than others.

Using Visual Studio For Date Comparison

On the one hand, if you’re making a simple comparison between, say, the values of two months then that’s not a big deal. On the other hand, if you’re dealing with months, days, years, the current date, timezone offsets, and different formats, then it can be a bit more complicated.

The point of all of the above, though, is not about strictly working with dates. Instead, it’s about the challenges that come with needing to write, test, and work with source code.

And if you’re in the habit of writing code, testing it in a browser, doing some form of debugging or dumping information onto a screen, and then repeating the process, there are easier ways to deal with this.

Continue reading

Load All WordPress Custom Fields via Database Query

When retrieving information from the WordPress database I prefer to avoid using direct database queries, but there are times in which they can be useful (and it’s important that it’s done right).

One use case in which it might be helpful is when you need to retrieve a set of data of a single type. Case in point: Say you need to load all WordPress custom fields.

At the time of this writing, there’s no function of which I’m aware that will do this, so here’s how I query the database to do so.

Continue reading

Team Communication (It Matters More So Than Your Tools)

Since bringing on a couple of contractors, one question that others ask is:

oWhat is it like to go from working on projects by yourself to working on projects with a team?

Or, more simply, what’s it like having contractors? The short answer is that I dig it because it affords some advantages:

  • we have to have a sharp division of work,
  • the business can take on more projects,
  • we’re able to collaborate on things (which is something I miss about flying solo),
  • and more.

The other side of this, though, is that I feel like I have to learn what it’s like to start a business all over again.

Team communication can feel like starting all over.

Like starting with a blank slate.

This, by no means, is a bad thing. It’s the opposite. But when you go from working on projects on your own and developing your setup, then there’s a period of adjustment that happens.

I’m still experiencing this and working through it. It requires both conversations with your team and a bit of introspection to determine if what you’re doing is still right for the way you work or if you should adjust it.

Continue reading

How To Start Blogging Regularly (Or Maybe Not)

I don’t write much about blogging on this site because it’s a bit meta and because I try to focus on WordPress development and related topics.

Blogging Regularly: Talking about it is a little meta.

Talking about blogging is a bit meta, isn’t it?

But one of the questions that I receive from fellow developers who are interested in blogging has asked this question enough times that I thought it might be worth providing a short answer here if for no other reason than I have a place to which I can link them when others ask me.

Continue reading

How To Get a WordPress Taxonomy By Term ID

Occasionally, when working on a project there are times in which it’d be nice to have an API function to help achieve whatever it is that needs to be done. Case in point: the ability to retrieve a taxonomy by term ID.

Get a Taxonomy By Term ID

Granted, it’s not a hard thing to do, but having the ability to retrieve the information from pre-existing functionality is always nice.

But when that’s not possible, we write our own way to do it, right?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑