DrDee
DrDee

Reputation: 3609

How to make Wordpress plugin first plugin to be run?

I am writing a Wordpress plugin that does string processing whenever 'the_author' filter event is fired. Obviously, there are more plugins that might respond to this event. I know that you can set the priority of your plugin but for example the Disqus plugin is called before my plugin even when I set my priority to 0. (I don't know if negative values are accepted).

The Wordpress Codex says about the $priority: "functions with the same priority are executed in the order in which they were added to the action".

So my question is, how can I make sure that my plugin is added first to the action? Does this depend on the name of the plugin?

Upvotes: 1

Views: 662

Answers (1)

nickohrn
nickohrn

Reputation: 2220

Negative values are accepted. Just use something like:

add_filter('the_author','my_function',-1000000);

Upvotes: 3

Related Questions