How to know what priority to use with add_action()?

range of priority values?
range of priority values?

Generally, speaking, you can’t know a priori what priority something is hooked with. The priority needed depends on how other callbacks where hooked in. Often that is the default value of 10 but it could be anywhere between PHP_INT_MIN (negative integers are still integers) and PHP_INT_MAX and there is no way to be sure except by experiment and, if possible (as with the Core and any themes or plugins that you are specifically concerned with), by examining the source.

Leave a Comment