It's wild that it's taken this long, and it still requires some fussing around by the user to enable the feature (for now), but at least it's here. And with it we can make the smoothest Google declutterer of all! Previous iterations here: Because everything in the universe is dumb by default, you first need… Continue reading Firefox finally supports custom search engines
Author: chairmanbrando
A rolling bike gathers no dust
It's hard to get back into something once the habit is broken. They say it takes three weeks or so to form a new habit, but at this point I'm pretty sure "habit" is not the word for this. After all, if a so-called habit can be broken so easily, doesn't that disqualify it from… Continue reading A rolling bike gathers no dust
WordPress rewrites your editor styles… sometimes
I'm using the old "2021" theme as a parent theme for this site. Why? Because it's the last of the default themes not based in Gutenberg blocks. So-called "classic" themes are the best themes. Fight me. Anyway, this theme has enormous post titles out of the box for whatever reason ⸺ the trend of the… Continue reading WordPress rewrites your editor styles… sometimes
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]
Resize images with WordPress's image editor in PHP
Say you've got a list of external images to output that may be huge and mongous. In my case it was images of houses up for rent from a big-ass XML feed. It's unwise to serve these images up directly to users given that huge payloads are generally frowned upon. What you need, then, is… Continue reading Resize images with WordPress's image editor in PHP
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!
There are scary drivers among us
A few posts back I mentioned that a benefit of having a dashcam is you can post your interesting clips for internet points. There are plenty of YouTube channels dedicated to compiling such footage, and I feel I'm a better and more defensive driver having watched very many of them over the years. One of… Continue reading There are scary drivers among us
Always visually inspect the chamber
I don't want to use the dorky phrase "lives rent-free in my head" as many of the terminally online do, but I'm not sure anything better describes it. Here we have a guy doing not one but two negligent discharges, back to back, in his apartment: There are two key takeaways we can glean from… Continue reading Always visually inspect the chamber
Debug PHP variables discreetly
If you don't have Xdebug involved in your current project, you may be relying on var_dump or var_export to check on things while coding. Depending on where in the code this happens, their output can get in the way of the rendering of a given page or be hard to read given where it lands… Continue reading Debug PHP variables discreetly
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
Getting around stupid paywalls
Paywalls have gotten quite prevalent over the years for a number of reasons I won't get into. I used to work for a company whose main income was selling ads on their posts about news, events, and the like, so I get the appeal of wanting people to pay for content. How these sites tend… Continue reading Getting around stupid paywalls
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