When creating a new user on WordPress multisite there is a “Skip Confirmation Email” checkbox that is unchecked by default. This unchecked box results in a user being added to a temporary “signups list” when they are added to the site. The user is not fully added to the site until they complete the confirmation steps in the email they receive. For many sites, it is preferable to check this “Skip Confirmation Email” when adding a user. With some code you can set this checkbox to default to checked.
WordPress Plugin
WordPress View Block Attributes
When developing a WordPress plugin that creates a Gutenberg block, it is invaluable to be able to view the attributes on the block. Here are some tricks I use to view this information.
trailingslashit() vs untrailingslashit()
WordPress has two functions that can be helpful when dealing with the final character of a URL, trailingslashit() and untrailingslashit(). I find it preferable to use untrailingslashit() for two reasons: 1. It does not break empty checks and 2. It makes my sprintf() statements more readable.
Check WP_DEBUG
Recently I was talking to another developer about how to detect ‘WP_DEBUG’ being set on a WordPress installation. Here is the code I use.
Sending WordPress Emails Through Gmail
Typically, if you’re sending any volume of email or sending emails to visitors you’ll want to use a third-party. Sometimes, you only need to send yourself notifications and are having deliverability problems with these notifications – this is the case, where you may want to send your emails through Gmail’s SMTP.
Modern Tribe Events Calendar Replace Default Event Link with Event Website
When using the WordPress plugin [The Events Calendar](https://theeventscalendar.com/) by Modern Tribe the default link in the calendar will point to the Event page. However, sometimes we want to point this link to the Event Website value (which we can set when creating the event). This is the code I use to do this.
How to Add a Twitter Hashtag with Scriptless Social Sharing
When using Scriptless Social Sharing, you may want to add a site wide hashtag to all of your tweets. This is the code you can use to do that.
ACF Uncaught TypeError: Cannot read property ‘id’ of undefined
Recently I was working on a site using Advanced Custom Fields (ACF) and the field input boxes had stopped working. In the browser console, I saw the error “ACF Uncaught TypeError: Cannot read property ‘id’ of undefined”.
Install a non-wordpress.org Plugin with WP CLI
The WordPress plugin repository at wordpress.org/plugins is a great resource. I often use WP CLI to install plugins on my WordPress site from there, however, sometimes I want to install other plugins with WP CLI.
Gravity Forms Default Value and Caching
I’m a big fan of the Gravity Forms Form builder WordPress plugin. I came across an interesting issue on a project where I was using the default value functionality and I wanted to make some notes as a warning for others (and myself) in the future.