In this recipe, we looked at the basic usage of actions and filters. However, there are a few important things to consider when using actions and filters. Let's take a look at them in detail:
- Use a priority value: The third parameter of the add_filter function or the second parameter of the add_action function is used as the priority value. This value will decide when the hook will be executed within the request. The default value is 10 for normal priority. If you want to run your hook after all other implementations of that hook, make sure to increase the value to a higher value. If you want to run your hook before other implementations, make sure to keep the value set to something less than 10. Using the priority value ...