Redux Framework not working when used in plugin

2019-05-21 08:35发布

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.

2条回答
一夜七次
2楼-- · 2019-05-21 09:00

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. :)

查看更多
我想做一个坏孩纸
3楼-- · 2019-05-21 09:08

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

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

before using it

查看更多
登录 后发表回答