The biggest project I work on at work is a React-based Web App (that ISN’T a Single Page Application). At its core it is a directory listing for people on a site which are represented by custom post types with associated custom taxonomies. We’ve tried to build it to be as flexible and customizable as… Continue reading Detecting Back Button Usage in Non-SPAs
Delayed React Rendering
Some of the plugins I’ve been working on rewriting lately to be fully block-based use React on the frontend for their interactive elements. When I first started moving from the shortcode-based elements with AJAX calls and manual DOM updating of pre-Gutenberg, I missed the quick initial page load of a page rendered in PHP. After… Continue reading Delayed React Rendering
Debugging WordPress REST API queries
TL;DR: Add this code to your plugin/theme and it will log all SQL queries (warning it can be a lot, and will impact performance) to a queries.log file in the current directory. And don’t forget to enable SAVEQUERIES in wp-config.php I’ve been working A LOT with the WordPress REST API for a plugin I’m writing… Continue reading Debugging WordPress REST API queries
Grep and Node.js
One of my most frequently used command line utilities is Grep, specifically grep -lir which searches for text inside files (great for finding where else I referenced that variable I just renamed). As I started using Node.js more and more (and consequently my node_modules folder grew bigger and bigger) I found myself getting more annoyed… Continue reading Grep and Node.js
Regex is MAGIC 🧙♂️
This is going to be a quick one, I should have included it in my post on “Printing the Internet” but I forgot. I do more manual data manipulation then I care to, but one of the biggest helpers in these endeavors is Regular Expressions. (the biggest help, BY FAR, is VSCode’s multiple cursors). My… Continue reading Regex is MAGIC 🧙♂️
My new Git-moji setup
I’ve been a HUGE fan of Ahmad Awais for awhile now. Among the things he’s created that I use daily are the git commit messages from his Emjoi Log repo. With the announcement that Catalina is going to default to zsh instead of bash I decided to explore the new shell and came across Ali… Continue reading My new Git-moji setup
VVV Multitenant update✌️✌️✌️ 🏢🔼
In the past few years, I’ve given a few talks about using a multitenant WordPress install for local development. I just finished doing some major updates, most significantly switching to VVV’s built-in certificate for HTTPS, and pushed the updates to the Github repo for the project. Feel free to give it a try if you’re… Continue reading VVV Multitenant update✌️✌️✌️ 🏢🔼
Ordering items in HTML forms
Recently, I was working on a plugin to convert ACF fields to the post content for a custom post type we use. The custom post type is used by another plugin I wrote that has per-site fields for the custom post type, varying from 3 fields to 37 fields. Since I wanted to make this… Continue reading Ordering items in HTML forms
Exporting WordPress pages in menu order
The original title for this post was “How to print the Internet in the correct order”, but my humor can fall a bit flat some times so I thought I better stick to a more descriptive title. We recently had a project at work that required us to print out the contents of one of… Continue reading Exporting WordPress pages in menu order
Super quick note on something that has been bugging me lately. If you’re using dot notation to access Javascript properties, you can’t have a property name with dashes in it (e.g. image.attributes.media_details.sizes.plugin-name-headshot
). Instead you need to use bracket notation with quotation marks. So in replace the example above with image.attributes.media_details.sizes['plugin-name-headshot']
.