Closed redlagoon closed 6 years ago
You may be running the call to get_instance()
too early. Try running it on action init
, prio 11
.
@jrfnl Works if I hook it to init
as expected!
But I'm thinking this could be problematic if I try to use it on other plugins / front-end. Any ideas on how to transport the data?
I'm not sure what you are asking.
@jrfnl
I'd like to improve upon TGMPA and allow a front-end screen for it (together with other options), so, a setup on its own, but without the need to go to the back-end. But I don't have access to TGMPA's registered instance, just its clean instance, so, it seems that if I call TGMPA on the front-end, it's empty, I just see its skeleton, while, if I call it on init
as you suggested, it works.
It seems that this won't ever work, so perhaps I should create an admin page and redirect the user to it?
Correct. TGMPA is designed not to work to front-end as that could be considered a security risk.
Got it. Can mark as solved.
I got TGMPA to work, it displays everything correctly, yet, when I try to pull data from the instance, it just doesn't come. Please note that I've used the generator for TGMPA using themeforest settings, as such:
http://prntscr.com/jqorge
Here's my input / output, used in multiple places:
Which results in:
There's no registered plugins.
But as you can see, the plugin clearly recognizes the plugins that need to be installed:
http://prntscr.com/jqoqid
The whole process of installing / updating works.
Any ideas?
Edit 1: As I thought. I lost the race and didn't catch
tgmpa_register
soon enough. Here's what I did:It seems TGMPA loses the plugin list as soon as that one hook is over, or rather, when it's "done" with them? What am I missing? Trying to make use of the list outside the plugin.