Tag: PHP


Understanding Copies & References in PHP

The inner workings of PHP aren’t something most WordPress developers need to worry about too much. Especially if you focus on the front end and are a master of flex-box (I’m neither) you probably can safely never understand the subtleties of copies and passing-by-reference in PHP (or any other programming language). But as you make more complex plugins, this stuff starts to get kind of important. Important enough that you should read this great article by our friend Josh Pollock and get at least a little familiar with it.



searchreplacedb2

As its GitHub documentation notes, the single-file PHP script searchreplacedb2 is “not terribly pretty, but it’s portable and it solves an important problem that comes up whenever WordPress sites get renamed.”




Spelunking into the Template Hierarchy

The template hierarchy is one of my favorite features in WordPress. It not only makes child themes possible, but it also makes the whole ecosystem better because more code can be written to sit in smaller and smaller chunks. This is great. What’s also cool about it is that it’s all enabled by a few relatively small chunks of code. But staring at them starts to expose us to some of the most interesting parts of WordPress.