Caleb Stauffer Style

Now Developing

Action Scheduler

Action Scheduler is a library for triggering a WordPress hook to run at some time in the future (or as soon as possible, in the case of an async action). Each hook can be scheduled with unique data, to allow callbacks to perform operations on that data. The hook can also be scheduled to run on one or more occasions.

actionscheduler.org

Originally created by Prospress (the creators of WooCommerce Subscriptions, acquired by Automattic), Action Scheduler is a “scalable, traceable job queue for background processing large queues of tasks in WordPress.” It is very robust, and very simple to use. And for a developer of my skill, an easy and enjoyable plugin to develop.

And contribute I have: at the moment of writing this, I have authored 30 issues and PRs, and contributed ~500 lines of code. My largest contribution (not yet merged) will be for the command-line interface (CLI).

Contributing to open source projects is my recommended way to learn, keep growing, and to stay busy. If you’ve an idea for Action Scheduler, or need support, create a GitHub issue, or reach out to me directly!

Collection

Collection

Source: https://github.com/crstauf/collection.

A drop-in for WordPress sites and themes to make managing collections of data and entities easier. Accessing top-level collections in WordPress are easy, but subsets of those can be more difficult. Collection fixes that.

Collection is… well, pretty much anything: IDs, colors, keys, text snippets, images… anything in WordPress. I frequently needed to access a subset of posts, pages, products, events, etc., and creating a Collection keeps those subsets readily available. Think of it as a fancy array of data.

continue reading on my GitHub

Photo by Umberto Cofini on Unsplash

Image Tag

Image Tag

TL;DR: https://github.com/crstauf/Image_Tag.

Whenever you upload an image to WordPress, multiple sizes of that same image are created. WordPress natively generates versions of the image in the following sizes (can be adjusted in Settings > Media):

  • 150px x 150px (hard crop)
  • 300px x 300px
  • 768px x 768px
  • 1024px x 1024px

This is really cool, because it means when you insert an image into a blog post, the properly sized image for your visitor’s device will be displayed (since WordPress 4.4).

But for a custom theme or plugin developer, reproducing that behavior is a lot of work, especially on top of everything else to go with properly implementing an image.

And thus, I created Image Tag (a.k.a. Image_Tag), a helper class for generating img tags within WordPress.

(more…)