Redux Framework not working when used in plugin

女生的网名这么多〃 提交于 2019-12-07 19:14:10

问题


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



来源:https://stackoverflow.com/questions/30568003/redux-framework-not-working-when-used-in-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!