Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 107 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Creating Custom WooCommerce Input Field

I’ve been working on a project that introduces a few new options into a standard WooCommerce installation, and one of the features calls for adding a custom WooCommerce input field.

WooCommerce

In WordPress, creating settings pages has its process. That is, you create the necessary options group (if needed), settings fields, values, and so on. You introduce any markup that’s needed, validation, sanitization, and so on.

And all of that is needed when it comes to working with WooCommerce, but one of the things that I like is how the API for the plugin supports creating input fields with server-side logic.

Continue reading

Append WordPress Page Content From the Database

When we – or the people for whom we’re working – create WordPress page content, it’s usually through the editor or maybe through some other client front-end that we’ve created.

But what about the case where there’s something specified using a custom settings page that controls the content displayed on a specific page?

This is getting into custom implementation territory so let me try to give a bit more context to this whole situation.

Continue reading

Sharing Code: A Good Opportunity To Exchange Ideas

In the previous post, I happened to share a screenshot of some source code that was from a 0.1.0 (or, perhaps more appropriately named, an MVP) of a project I’m writing (and it turned out to be a good opportunity to exchange ideas with someone else).

Exchange ideas based on your source code.

Not long after it had gone live, I received a tweet containing the following comment:

Interesting to see how differently people work. There at least four things in your screenshot that I wouldn’t do.

From experience and from being online long enough, I know there are certain segments of our industry who look at something like this and think “Burn – he’s got it down and he’s going to take him to school.

Except not really.

I believe I’ve talked about this in previous posts, but what I’m getting at is when others make comments like this to you, approach it in two ways:

  1. Understand they are coming from a place of [likely more] experience,
  2. Ask what things they would do differently. Odds are they have good reasons and are likely in a position to help you get better at what you’re doing.

Later in the post, I’ll share the entire conversation that took place on Twitter but I think it’s important to mention that, at this point in time, I know the person in question well enough to have both respect and no problem in engaging them in further questions and conversations about things like this.

But it hasn’t always been that way. So for those of you who are getting into sharing your code and learning how to field feedback that comes regardless of the format, then this is primarily for you.

Continue reading

Custom Plugins: What’s Loaded, What’s at the Ready?

The longer I work in building custom plugins for other people, the more I’m convinced of the advantages of maintaining a personal library of classes (or functions depending on your style) that help expedite tasks that are common to every project.

Sure, it can be hard to determine what you’ll require for every project and what you’ll require for some projects.

Custom Plugins and Required Files

And there’s nothing wrong with focusing specifically on the latter, but there are advantages that you have, at the bare minimum, a foundation off of which you can build custom plugins for others without constantly re-writing the same code over and over and over.

And over.

And you get it.

So what are the things that we should have and what are the things we should save, say, at the ready?

Continue reading

Intuition, Laziness, Discipline, and Experience

When I sat down to write this post, I didn’t have an idea as to convey what I wanted to say. (And that’s a ridiculous thing to feel when you’re writing. )

Honestly, I just had a single sentence that I’d jotted down a few days ago and was going to flesh out in more detail.

Developer Intuition

I wrote:

You begin to develop a sense of intuition for how something should be designed or implemented.

It’s not even really a fully developed thought. It’s just a statement (and I’m not even sure it’s a good one) that I was going to explain in more detail. But then I stumbled across this post and found this statement:

I’ve become a big fan of the “do less & be lazy” approach to building things.

And though the post is about the performance of pages using web fonts, it’s still related to what I want to convey.

All that to say I didn’t have a post, just a statement, and I needed an opener. In reading another post, I found it in the quote above.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑