In PHP 5.5 the DateTimeImmutable class was introduced. Immutable objects are nice in that they can not be modified, which helps reduce the likelihood I make certain types of errors. This is how to ensure the DateTime you’re working with is immutable.
I’ve been using Local by Flywheel for my local WordPress development and I wanted to use Xdebug with Visual Code Studio with it. These are the notes I’ve made for myself in case I need to set this up again in the future.
When developing a WordPress theme, I often need to ensure I’m loading the latest version of the CSS file I’m working on. One way to do this is by appending a URL parameter (e.g. ?ver=123) that gets updated each time the file gets updated. Load Newest Assets Plugin Thanks to Corey Salzano for pointing out […]
There are a number of different inline conditionals I use when working with PHP (i.e. ternary conditionals and the null coalescing operator). As a reminder of how some of these common inline conditionals work, I put together this table for reference.