Open cliffordp opened 5 years ago
Closest thing is $success = \TGM_Plugin_Activation::get_instance()->is_tgmpa_complete();
but it doesn't work for what I am asking it to do.
That is not how TGMPA is supposed to be used. TGMPA is a back-end tool with it's own flow which you can hook into to add your requirements and such.
For your own plugin flow, you should hook into the WP native hooks, not the TGMPA hooks.
Also, as plugin folder names and plugin names can be changed, TGMPA can not necessarily definitively say that the requirements are full-filled, only that there is nothing more for TGMPA to do.
You should generally still do a check for a constant/class/function in the dependency which you want to use to be sure it is available and to avoid white screens of death and such.
This looks to be what I was wanting, in case anyone else comes looking: https://github.com/micropackage/requirements
I assumed there would have been an action hook like
'tgmpa_all_required_have_passed'
and then I can load my own plugin's init() on that action.Or even just having
tgmpa()
return true/false.Thanks for any help.