Post Metadata, Gutenberg, and SlotFills – Part 1

When I started writing this post, the idea behind it was going to be how to two things:

  1. Understand SlotFills in the context of WordPress and Gutenberg
  2. Create a SlotFill for introducing metadata

But the more I began writing, the more I recognized there’s a lot of material to cover. So in an attempt to write content that’s short, to the point, and practical (with the theory behind it coming later)

I thought I’d start with the first point and move to the next. The general idea behind what I want to do i sthis:

  • Provide a short introduction to SlotFills
  • Explain how to add your own SlotFill to WordPress
  • Save data from the user to the database (and verify it’s there)
  • Adding a column to display the post metadata in the All Articles view
  • Search the data just like you would titles and content
  • And then a short note about table prefixes

This is not a table of contents but a general guide of where I’m going with all of this. (Though feel free to bookmark this page.)

With that said, let’s started with a general introduction to SlotFills before going any further.

Continue reading “Post Metadata, Gutenberg, and SlotFills – Part 1”

Merry Christmas and Happy Holidays (For 2019)

Every year, I try to take the time off from Christmas to New Year’s to be with family and friends and this year is no different.

During my time off, I’ve spent a bunch of time with my family, seen Star Wars: The Rise of Skywalker (and it was great to share the experience with my kids to see the movie on the big screen!), and already spent some time with my in-laws to celebrate the holiday.

Continue reading “Merry Christmas and Happy Holidays (For 2019)”

Deactivating WordPress Plugins with SQL

If you inherit a WordPress codebase, regardless of the age of the project, there may be a lot of context that you don’t have as to why certain decisions were made or how things were implemented.

This may include the server, infrastructure used to help power the site or the app, and other contextual information about the environment in which it was running.

This type of information can be server-related information, PHP version, database type, information that’s actually stored in the database especially if you do a database import, and so on.

This image has an empty alt attribute; its file name is table-plus.png

Ideally, all of this is handed over but that’s not always the case. Anyway, say you attempt to start it up and then when you attempt to start up the application, not only does it not work but it either shows a white screen or displays a message about technical problems with your installation.

Continue reading “Deactivating WordPress Plugins with SQL”

How To Fix the Referenced PHPCompatibility Sniff Error

There are a lot of nice packages that we can use in our PHP-based projects and if you’re using Composer or GrumPHP, PHPCompatibility is one that I recommend including your projects especially if you’re writing code for something that’s going to run across multiple versions of PHP (that is, on hosts that offer different versions).

This is a set of sniffs for PHP CodeSniffer that checks for PHP cross-version compatibility. It will allow you to analyse your code for compatibility with higher and lower versions of PHP.

PHPCompatibility Repository

This is something that be installed within composer and it’s something that I recommend for people writing code for WordPress because of how much variation exists within our hosts.

Occasionally, though, you may see a problem like this:

And if you run $ phpcs -i you may get a message that’s unclear.

Continue reading “How To Fix the Referenced PHPCompatibility Sniff Error”

Time Off 2019: Part 3 of 4 of Social Media Sabbaticals (No Time for Four)

If you’ve followed along with the previous articles this year, you’ll notice that I didn’t actually take time off each quarter.

  1. Time Off 2019: Part 1 of 4 of Social Media Sabbaticals
  2. Time Off 2019: Part 2 of 4 of Social Media Sabbaticals

As I head into December of this year, this will be the final – and obviously the third – time I take off the social web for the remainder of the year. At least that’s the plan. I’m thinking of doing it a little bit differently this year.

For those of you who haven’t read about my doing this in years past, check out:

  1. The First Social Media Sabbatical of 2018
  2. The Second Social Media Sabbatical of 2018
  3. The Third Social Media Sabbatical of 2018

Though I don’t really do year in review posts, going back to read these and see how things have panned out over the years is always fun and is as close to retrospectives as I get.

With all of that said, I’d summarize the entire year by saying: It’s been a year, if nothing else. Some ways bad, some was fantastic.

Continue reading “Time Off 2019: Part 3 of 4 of Social Media Sabbaticals (No Time for Four)”