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.
TL;DR: I’m going to be working on a series that looks how to achieve a useful task with taxonomies, likely categories, then refector 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 an 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 thus, as I’ve been thinking about various topics to write about (after taking an admittedly longer period time off than I planned), though 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.
And for anyone who has read Coding Horror within the last decade or so, you’re likely familiar with Atwood’s Law:
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.