Pluggable function and activation check?

Plugin is defining pluggable wp_mail() function. My idea was to check if function is defined already and throw warning if other plugin beat me to it.

However this warning causes issues on activation. As far as I understand during normal operation plugin is loaded before pluggable.php but for the purpose of activation check it is loaded after pluggables.

What would be the robust/proper/suggested way to implement such check for pluggable function? There is no obvious (for me) way to distinguish activation and handle it separately.

1
1

Don’t do the check on activation?

Seriously, the best way I can think of is not to check for this on activation, but only in the normal plugin load process. And instead of throwing a warning (I assume you mean a PHP E_WARNING), perhaps putting an admin error box up would make more sense.

Leave a Comment