Redux 框架在插件中使用时不起作用 [英] Redux Framework not working when used in plugin
问题描述
我将使用 redux 框架作为我的插件选项,它显示在管理面板中,我可以保存设置,
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,
所以问题是我没有通过打印全局 opt_name
变量来获取选项值.
So the problem is that i m not getting the option values by printing the global opt_name
variable.
如果我将 redux 框架配置文件添加到主题 functions.php 然后它工作,但不能在插件中工作,
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.
推荐答案
这里是 Redux 的首席开发者.
Lead dev of Redux here.
问题是 Redux 还没有机会运行!
The issue is Redux hasn't had a chance to run yet!
如果您正在使用新的 Redux API,只需运行:Redux::init('opt_name'),它就会突然起作用.:)
If you're using the new Redux API just run: Redux::init('opt_name') and it will suddenly work. :)
这篇关于Redux 框架在插件中使用时不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!