Currently reading: Stories of Your Life and Others by Ted Chiang

Add a keyboard shortcut to preview a WordPress post in a new tab [updated]

I use post previews constantly. There's a reason I wrote code to move my drafts and scheduled posts to the top of the posts list! Imagine my disappointment, then, when I didn't see any keyboard shortcuts within Gutenberg to open a post preview in a new tab. Well, as I'm a big fan of userscripts,… Continue reading Add a keyboard shortcut to preview a WordPress post in a new tab [updated]

Blinded by the light!

Does writing on GDocs have your eyeballs feeling a "closeup in Spongebob" sort of way? Try this! First, install the Stylus extension if you haven't already. Remember, though, to get Stylus and not Stylish as the latter was bought out and injected with spyware. That's a whole can of worms you can read about if… Continue reading Blinded by the light!

Get a damned dashcam already!

You ever come across a traffic jam caused by people who were in a small accident and then left their rides in the road? They're endangering themselves and others and causing traffic issues by blocking a lane or three. What are they even doing? Well, they want to preserve the "crime scene", so to speak,… Continue reading Get a damned dashcam already!

Get a list of all WordPress hooks that have run

In order to truly catch them all, we can use a "must-use" plugin. These live in the /wp-content/mu-plugins folder as flat PHP files that are automatically included, in alphabetical order, before much has happened in the WordPress core loading process. Normal plugins load fairly early, but these are pulled in even earlier. Their inclusion can't… Continue reading Get a list of all WordPress hooks that have run

WordPress shortcodes don't need fully-qualified parameters

In other words, you don't need to do something like this… …because the shorter way will work just fine. Instead of a named array, the passed parameters will simply be a standard numerically-indexed array ⸺ i.e. a "list" in PHP parlance. Nice, eh? All you have to do is account for one or more of… Continue reading WordPress shortcodes don't need fully-qualified parameters

Nested pages cannot be found with WP_Query

It's hard to believe, I know, but despite its massive list of available parameters, WP_Query somehow doesn't seem to have the tools available to look for grandchildren (and beyond) when querying hierarchical post types. Due to it only supporting the post_parent field, you end up having to nest queries, use custom SQL, or use post__in… Continue reading Nested pages cannot be found with WP_Query