Custom hooks
-
Hi,
I would like to use several wp_head custom hooks for the purpose of inserting one code above another code in the head.
To do this, I set the custom hooks as follows (hook name —> action —> priority):
Header —> wp_head —> 1
Header New —> wp_head —> 2As you can see in the screenshot, both hooks are enabled.
https://i.ibb.co/S7nC7BK/hooks-01.png
Thus only one hook named Header is used in the block settings.
The second hook named Header New is not used neither in this block nor in any other.https://i.ibb.co/nc3HhZD/hooks-02.png
And now begins the most interesting part.
If we look at the source code of the page, the code of the block, in which the hook named Header is used, starts to be doubled, as if this block also used the hook named Header New.
If I uncheck the option with hook named Header New then everything is fine.https://i.ibb.co/Jcp0S53/hooks-03.png
Question: Why is it duplicated if I am not actually using a hook named Header New, but only pointing out that it can be used? Is this the way it should be?
In other words, should a plugin call a custom hook that is not in use?
- The topic ‘Custom hooks’ is closed to new replies.