When two or more filters are hooked to the same filter hook, the conflict is resolved as follows:
- If the filters are hooked with a
priority parameter, the filter with a lowest value for the priority will be executed first. If no priority value is supplied, the default value is taken as 10.
- If two or more filters are hooked with the same priority, the filter that was hooked first will take priority.
In the above example,
filter_4() will be called first, followed by
filter_3() have same priority ie. 10. Hence,
filter_2() will be called next because sequentially,
filter_2() was added before
filter_3(). And of course, finally
filter_3 is called.
Reference: Wordpress Codex Page.