Where and How to Use WordPress Hooks in Objects
You’ve maybe noted that we’ve recently been writing about WordPress and object-oriented programming in PHP a lot. Just last week, Fred published an article about PHP magic methods, especially __construct, and how they work. This week I want to tackle a very common and oft-debated question about WordPress and OOP: when I use WordPress hooks, where do they go on my objects?
Object-Oriented PHP: The __construct() Magic Method
In this article, we tackle an intermediate topic in object-oriented PHP: magic methods, specifically __construct().
Understanding Class Inheritance (Child and Parent Classes) in Object-Oriented PHP
Last time, we covered the fundamentals of object-oriented programming (OOP) in PHP: what an object is, what a class is, and how they interact.
Introduction to Object-Oriented PHP for WordPress Developers
Our goal today is introduce object-oriented programming in PHP, as the basis to discuss OOP in WordPress.
How to Customize Your WordPress Post Excerpts
The WordPress excerpts system works properly, but it uses lots of functions and it’s hard to know which one does what.
How to Sort Posts by their Taxonomy Terms
setup_postdata(): The Template Tags You Need, the Custom WP_Post Arrays You Crave
setup_postdata() lets you treat any bundle of posts the way you would normally treat the results of a WP_Query.
Lazy Loading for Faster WordPress: Slow and Lazy Wins the Race
David wrote a really good article on WordPress site speed a few weeks ago. He also, casually, made WPShout a lot faster—up to an 89% desktop score on PageSpeed Insights, which is about as high as I’ve ever seen a WordPress site score.
The Hybrid Plugin/SaaS Business Model
Editor’s note: Today we’re delighted to invite back one of WPShout’s dearest friends: Josh Pollock!
How to Migrate a WordPress Site with WP-CLI and rsync
There are lots of ways to migrate a WordPress site. Lots of plugins can do it. You can do it over simple (S)FTP. But the quickest way I know of is via rsync and WP-CLI. But that does come with an important proviso: you need to have access to a shell (via a simple local terminal or SSH) to both ends of the migration. And that’s often harder to do than the plugin or SFTP route. But if you’ve got that, this way is a great deal faster.