Code to add a custom column to the WP Admin Posts listing page.
WordPress Filter
Add Gutenberg JavaScript Filter
WordPress PHP filters allow you make a value modifiable from outside of your code. With the WordPress Block Editor (a.k.a. Gutenberg), you can now do the same thing in JavaScript.
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.
Override WordPress Publish Date on Creation
When creating new posts for a video demonstration, I wanted to display a consistent date. While my first thought was to reset my system clock, this snippet overrides the date when the post is first created, which worked for me.
Remove target _blank from the Scriptless Social Sharing Email button
I like to use the Scriptless Social Sharing WordPress plugin to add Share buttons to my blog posts. Recently I had a client notice that because the Email Share button has target=”_blank” in the HTML markup, it opens a new tab when clicked. This is great behavior if you’re using web based email (e.g. Gmail), however if you’re using an email application on your computer, you end up with a blank tab. This code removes target blank from the email share link.
Featured Image Label for WordPress
I often find it helpful to add a label to the Featured Image area in the WordPress admin. By guiding clients to upload the appropriate sized image, it lets me avoid them being surprised by WordPress cropping their image in an unexpected way.
UTM parameters with Scriptless Social Sharing
When it comes to adding social sharing buttons (e.g. “Share on Facebook”), I’m a big fan of Scriptless Social Sharing by Robin Cornett. The one thing I like to do when using it is add UTM parameters to the links that are shared. Here is the snippet I use to add UTM parameters to my URLs that are being shared.
Make Your WordPress Plugin Easy to Extend
As a WordPress developer it is a painful (and all too familiar) feeling of angst, when I find a plugin that does almost exactly what I want but the author has left no way for me to modify the behavior without changing their code. Don’t Hack Core (or plugins) A popular refrain in WordPress developer […]
WordPress Add Content to RSS Feed
Recently, I wanted to add content to each item in the RSS feed on a WordPress site. This could be something like: Hire Sal If you enjoyed this article, have you considered hiring Sal to help with your project? To add this, we can leverage the WordPress filter the_content_feed. The code would look something like […]
Skip Dashboard WordPress Plugin
I find I spend very little time on the WordPress dashboard. Additionally, the Dashboard can be confusing for users when all you want to do is write a blog post. Thanks to the power of WordPress filters, we can send users directly to the backend Posts screen on log in and skip the dashboard. We […]