I got this image from one E-book for WP plugin development. Could you please clarify me why the Plugins are loaded before Pluggables.
I got this image from one E-book for WP plugin development. Could you please clarify me why the Plugins are loaded before Pluggables.
You must be logged in to post a comment.
Directly from source for
pluggable.php
:So, there’s your answer, the functions in
pluggable.php
are intended to be overridden by Plugins.Re: load order:
See this post by Konstantin Kovshenin. The relevant points (10-15):
So, simplified:
pluggable.php
is loadedplugins_loaded
action is firedWhich is the expected order.
(Note: this all takes place in
wp-settings.php
.)Don’t use pluggable functions!
Please note that you can never be sure, that a later plugin doesn’t override your pluggable! I wrote on wp-hackers mailing list about this some time ago.
There’s also another thread on wp-hackers that talks about that there’s no fallback implemented. Please also read the related trac ticket.