-->

Redux Framework not working when used in plugin

2019-05-21 08:28发布

问题:

I'm going to use redux framework for my plugin options, it is showing in admin panel and i can save the settings,

I used the sample config file for option panel,

So the problem is that i m not getting the option values by printing the global opt_name variable.

If I add the redux framework config file to theme functions.php then it worked, but not working in plugin,

Please help me if some one know about the problem.

回答1:

Lead dev of Redux here.

The issue is Redux hasn't had a chance to run yet!

If you're using the new Redux API just run: Redux::init('opt_name') and it will suddenly work. :)



回答2:

If you try to run Redux in plugin, just run :

Redux::init("opt_name"); // opt_name is your opt_name

before using it