From the course: WordPress: Action and Filter Hooks

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Tips for using third-party hooks

Tips for using third-party hooks - WordPress Tutorial

From the course: WordPress: Action and Filter Hooks

Start my 1-month free trial

Tips for using third-party hooks

- [Instructor] WordPress has hooks, you can write your own hooks, and you can use hooks that other developers have added to their themes or plugins. You get a hook, you get a hook, everybody gets a hook. In this lesson, I'd like to go over a few best practices when it comes to using third-party hooks in your WordPress plugin or theme. First, if your plugin is 100% dependent on another plugin or a theme framework, don't let your plugin even be activated and display a friendly error saying something like, "Hey, we need this other plugin to be active "in order for this plugin to run." To show you an example of this, let's go back to that debug-bar actions and filters add-on that we looked at earlier in the course, and you may remember that it requires the debug-bar plugin. So, let's look at the code base, and by the way, you can view the code base of any plugin that's in the wordpress.org repository. Simply go to the Plugins…

Contents