Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to only load my plugin if all required ones were found sufficient? #760

Open
cliffordp opened this issue Oct 7, 2018 · 3 comments

Comments

@cliffordp
Copy link

cliffordp commented Oct 7, 2018

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.

@cliffordp
Copy link
Author

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.

@jrfnl
Copy link
Contributor

jrfnl commented May 1, 2019

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.

@cliffordp
Copy link
Author

This looks to be what I was wanting, in case anyone else comes looking: https://github.com/micropackage/requirements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants