Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 169 of 219)

Articles, tips, and resources for WordPress-based development.

Passing Variables in WordPress: WP_Query

Check out the second post on passing variables in WordPress in loops.

One of the most minute aspects of writing code is opting when – or when not – to use variables.

It sounds like a trivial decision, right? And in some respects, it is, but the longer I’ve been writing code (or, perhaps a better way to put it), is that the more code that I’ve written and had to maintain, the more my opinion has changed on how frequently I use variables.

After being in the industry for a couple of years, I tried to follow the this rule of thumb:

“Only if I need to use this value more than once, then I will store it in a variable.”

And I still think that’s a decent rule of thumb, but the more I’ve worked with systems that, say, interface with a database, or that leverage multi-dimensional arrays, or that some type of iteration (be it an each iterator, a foreach iterator, or something similar), the more I’ve found how storing a variable – even if it’s only going to be used once – can make for slightly more readable code.

Continue reading

Organize WordPress Terms in Alphabetical Order

I’d argue that, at this point in time, working with WordPress taxonomies has never been easier.

Sure, creating, tagging or categorized, and adding custom taxonomies to posts and custom post types has always been relatively easy, but when it comes to implementing a solution that utilizes custom post types and/or custom taxonomies, then constructing queries can sometimes be a bit of a pain.

But now, we have more API functions and features than ever before:

Of course, there are still cases in which retrieving and organizing data still leaves something to be desired. 

I don’t fault WordPress for this, though. It’s more of a function of how data is ordered within databases, applications, and in computers in general.

Continue reading

Should WordPress Editor Styles Be Required For Premium Themes?

At this point, there are a number of great content management-related features that are built directly into WordPress that are easy for theme developers to employ.

Some of these features include:

  • Enabling post formats
  • Automatic feed links
  • Setting the default content width
  • Opting to enable (or disable) featured images
  • …and so on.

And many of these features are widely used by a variety of different themes. Obviously not every theme uses all of the above functions but many use some of them.

But there’s one native feature that, for one reason or another, doesn’t seem to have taken off as much as other features:  WordPress editor styles.

This is a bit odd to me, because I think it’s one of the features that can greatly enhance the experience with a theme, and I think it can contribute to create greater differentiation in premium-grade products.

Continue reading

The Hate and Vitriol of WordPress

For anyone who has worked with it or worked on it long enough, you are likely familiar with the criticism, the hate and vitriol of WordPress.

Straight up, people despise WordPress, its codebase, the fact that people not only work on it, but also write about it, build for it, and make any argument for using it outside of its primary use case of being a blog and/or a content management system.

And as a developer – especially one not only new to WordPress, but one who is new to programming in general – this can become really discouraging.

In fact, I’ll go as far as to say that it can make you question not only your ability as a programmer, but your ability to learn the tools, methodologies, and practices of software engineers who work with other languages, tools, frameworks, and so on.

Continue reading

My Workflows For WordPress: Self-Hosted Projects

In the previous article, I shared a bit about how I try to streamline my workflow based on where my WordPress project is hosted.

Specifically, I talked about having the codebase hosted in a Subversion repository, using the provided support forum solution, and how I manage tickets. I also talked about how all of the decisions for how I manage the project stem from where and how the source code is managed.

To that end, whenever I’m working on a self-hosted project (or, rather, one that is not included in the WordPress plugin repository), then I end up going with a slightly different workflow.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑