Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 17 of 219)

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

Sort WordPress Posts By Date

TL;DR: If you’re looking for an easy way to sort WordPress posts by date (be it descending or ascending) in the administration area without having users click on the Date column header, you can do so through the use of the pre_get_posts filter that provides a reference to the instance WP_Query running on the page.

For examples in code on how to do that, check out the rest of the article.

Continue reading

Add a Custom View to the All Posts Screen

TL;DR: I’m going to be working on a series that looks at how to achieve a useful task with taxonomies, likely categories, then refactor it into an object-oriented plugin that will serve as a utility plugin for taxonomies, in general.


A Brief History of OOP Posts

Some time ago, I did a lengthy series about the principles of object-oriented programming (and tried to share a decent amount as to how to achieve certain things within the context of WordPress).

I’ve also written a bunch of articles about the whole paradigm over the years for those who are interested in catching up on some of those articles.

And I’d be remiss if I didn’t share that a good friend of mine has literally written a book on the topic, too.

And thus, as I’ve been thinking about various topics to write about (after taking an admittedly longer period of time off than I planned), thought that it might be worth talking about practical things we can do with normal APIs and hooks and then refactor that into a type of utility plugin.

Continue reading

Learn JavaScript, Forget PHP?

The landscape of WordPress has changed.

time lapse photography of green field and clouds

A few years ago, we were all tasked with learning JavaScript deeply and rightly so. With the advent of Gutenberg and projects like Calypso, it’s obvious that JavaScript is becoming a dominant force in WordPress (not to mention the web as a whole), if you don’t consider it to be so already.

And for anyone who has read Coding Horror within the last decade or so, you’re likely familiar with Atwood’s Law:

any application that can be written in JavaScript, will eventually be written in JavaScript.

Jeff Atwood

But as this has happened, it seems as if its created a clearer divide between what constitutes a front-end developer and a back-end developer in the WordPress economy.

Personally, I welcome it as I find myself even more eager to learn, grow, and work on the back-end as PHP grows and changes. But that’s just me and there’s more to examine.

Continue reading

How To Change Local By Flywheel PHP Settings

If you’re using Local by Flywheel to work on your projects, there may be times where you need to make customizations to the PHP configuration when the site starts.

Before getting started, note the following:

  1. At a high-level, Local will start a containerized environment,
  2. A containerized environment will have its own set of configuration every single time it starts
  3. This means that you cannot change any configuration to the OS-level installation to achieve the changes you need.

So what do we do?

Continue reading

Setting Up PHP CodeSniffer Per Project

A few years ago, I wrote a post about Setting Up PHP CodeSniffer in Visual Studio Code (and I’ve recently updated it, too).

But it’s been four years since that post was originally written and, in that time, a lot can change in terms of how we write code.

Four years is roughly an Internet Age, isn’t it?

Anyway, the basic points of that article still stand, but if you’re working on a variety of projects and some of them require different configurations, settings, and standards, then the way you go about installing and configuring PHP CodeSniffer may be different than how you configure it on a system-level.

So if you’re in that position, here’s how you can configure PHP CodeSniffer on a per project basis using Visual Studio Code.

Continue reading
« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑