Blog

Hooked on WordPress! Introducing the new Hooks Generator

Today we have special news for you guys. Especially for you aspiring developers. We have just released the WordPress Hooks Generator, and we’re sure it’s bound to be a HIT!

So… What Are You Trying to Solve Here?

As you probably already know, nearly any type of work with WordPress requires you to utilize the Plugin API, be it one way or the other. The way many developers go about using Hooks in their code is as follows: They visit the WordPress Codex or the Developer Reference. Then, they copy a generic snippet from one of the webpages that has information about the hook they’re looking up. If they’re lucky enough, they find all the parameters and documentation they need. But in many scenarios, snippets for hooks out there are usually too specific (per use-case) and will often miss out on vital information for many other use-cases.

Building up on that, developers can’t really utilize the advantages Hooks present this way. How can you tap into a filter if you don’t really know what parameters it accepts? Or what kinds of data you can modify?

This is a challenge we tackle here with the Hooks Generator.

Time To Make It Easier on Yourself

With our new Hooks Generator, you can now tap into WordPress’ filters and actions, see the various parameters each Hook accepts and use them in your code with ease and speed.

Hooks Generator 2016-03-16 17-27-15
Main screen for the Hooks Generator

 

The biggest advantage of using the new Hooks Generator is that it allows you to dive back into your code as quick as possible, with little to no interference. By adopting WordPress’ standards for the Plugin API, the Generator ensures that you stay on top of your development flow, your project’s demands and most importantly, your productivity.

 

Autocomplete in the Hooks Generator
The autocomplete function

 

We’ve also taken special care of the hook selection process and made it so you can use a simple auto-complete field to easily and quickly locate the hook you’re looking for, and get cool insights about it in a snap.

Also, check out the “Code” section, which lets you code away the body of the callback function in a stylish and fun way, just like you’re used to in your favorite editor.

 

Hooks Generator 2016-03-16 17-58-48
The code section lets you further customize the callback

Before I Wrap This Up, a Few Quick Notes

For now we have disabled all Variable Hooks. Meaning, hooks that have variables included in them. A simple and well-known example would be publish_{$post_type} (official documentation here). We’re planning to introduce support for this soon, so please be sure to follow us on social media.

Finally, if there are any Hooks missing (that are not Variable Hooks), please let us know via the comments section below and we’ll take care of it.

Can’t wait to see what you guys will create with this Generator. Enjoy!

Maor Chasen

A proud WordPress Developer and contributor. Maor focuses on plugin development and occasionally contributes to WordPress core.

Leave a Reply