Hi!
Throughout my time with Roots I’ve come across a small collection of tools that make my daily life as a developer easier. A recent reply in another thread about how to easily register post types got me thinking that a library of make-my-job-easier tools might be useful.
This is meant to catalog tools that make the task of creating themes and plugins easier. Cool stuff you can do with yarn libraries are awesome, but not the focus of this thread.
Here’s what I use a lot:
PostTypes
A super useful class for easily registering post types.
- Include this class with
composer
- Register your post type with one line:
$books = new PostType('book');
The documentation at the link below goes into detail on setting post type icons, columns, supports, etc.
I tend to go overboard with post types and create them all as separate mu-plugins
and this class takes a lot of the work out of that task.
Gamajo Template Loader
You know how WooCommerce and The Events Calendar include their own default templates and let you override them in your theme? This class let’s you do that for your plugins.
The documentation goes into much greater detail that I could cover here. I tend to use this for plugins for shortcodes that I use across multiple projects to include the views along with the functionality. I haven’t figured out how to get the override themes to work with Blade yet but this is still a great tool for plugins that include templates!
So how about you all? Do you have tools like this that you use on a regular basis to make your job easier?