Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 273 of 428)

Adding Multiple Sections on WordPress Options Pages

One of the most confusing aspects of working with WordPress is the Settings API.

In an attempt to make a little bit easier to understand, I’ve written a series that takes a long look at the API as well as an example project that’s available for download for others to study (and to contribute to in order to improve).

But, as with most things in programming, there are still things that can crop up now and again that can leave you scratching your head. Case in point: Let’s say that you want to introduce two sections (or three or four, even) to a single options page.

Unless you do this correctly, you’re likely to notice that the ‘Save Changes’ button will only save the changes to the last group of options. Luckily, there’s an easy way to keep your options logically grouped while also maintaing serialization through a single ‘Save Changes’ button.

Continue reading

Isolating Styles When Creating a Theme-Specific Plugin

This is probably the most unique way that I’ve started a post since I’ve been writing here, but given the fact that my family continues to grow every couple of years or so, I figure that it stands to reason that the forthcoming example would be inevitable.

This past weekend, I was doing the usual routine of unboxing, ahem, diapers, refilling the wipe container and so on.

I told you this was going to start off weird.

I told you this was going to start off weird.

There’s nothing spectacular or unique about what you see above, except for the fact that Huggies makes both the container and the wipes that fit within the container.

But here’s the neat thing: when you purchase the wipes made by the vendor of the container, they provide a separator to let you know exactly how many to get out to fill the container.

The divider separates how many wipes fit in the container.

The divider separates how many wipes fit in the container.

I hesitate to say that this is kind of “neat” because, y’know, we’re talking about diapers. Additionally, we can technically buy any wipes and/or any container just so long as the wipes stay fresh, right?

But when you purchase both of the products from the same vendor, then there’s this small bonus that you get in terms of grabbing the exact amount of wipes you need for the container.  Obviously, the two were made for one another.

So, naturally, I made the leap into thinking about WordPress themes, WordPress plugins, and theme-specific plugins.

It’s what anyone would logically do, right?

Continue reading

Data Models in WordPress – Their Perspective, Not Ours

When it comes to treating WordPress as a web application foundation (and I dislike the use of the word framework, because that’s not what it is), one of things that I think that we, as developers, need to do a better job of doing is to introducing features that more conceptually map to the model of the data we are tasked with introducing for our users.

Sure, it’s one thing to introduce domain language into the solution that we’re building for our users, but there are greater strides that we can make in terms of introducing features and components that do a better job of mapping to the user’s problem.

Continue reading

Organizing WordPress Content Types and Libraries

Last week, I shared a post on how I go about organizing my WordPress theme functions.

Generally speaking, the conversation that ensued in the comments was more interesting the post itself (at least as far as I’m concerned :) because it raised some interesting points of how others organize their files, as well as raised questions as to some strategies for organizing other types of files.

Specifically, Mike said:

I did the same thing recently with the /inc/ folder and needing to add a bunch of different loop files for post types, wondering if I should add a folder within the /inc/ to separate the loop files from the other files I needed. I think I may have been over complicating things a bit, too.

I thought it was a good comment and my answer is a bit longer than a normal comment, so I thought I’d draft a post about it not only to share my thoughts, but also to allow others to chime in, as well.

After all, half the reason I end up thinking through some of the things that I do comes from opinions shared in the comment stream, in related Tweets, and so on.

Continue reading

The Logo for the WordPress Plugin Boilerplate

As discussed earlier last month, the next version of the WordPress Plugin Boilerplate is currently in development.

For those who are interested:

  • You can find the current stable version on GitHub.
  • The `develop` branch to which the core team and I are working (though we’re not currently accepting pull requests).
  • And you can read about the changes in the upcoming version in this previous post.

The foundation of the status of the next version of the Boilerplate currently leaves a lot to be desired, but the team and I – along with the help of Slack (probably a topic for another post ) – are in the process of planning the upcoming website that will accompany the project.

Slack - WordPress Plugin Boilerplate

The problem? We’re all developers, but we need a logo.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑