将变量传递给define() php
有谁知道如何使用定义函数并向其中传递变量?也许我完全做错了?我在 WordPress 设置 API 中设置了一些选项,并尝试将选项值传递到我的插件中。
我做错了什么?
define("MAPS_HOST", "maps.google.com");
$options = get_option('plugin_options');
var $gMapKey = $options['map_key'];
define("KEY", $gMapKey);
Does anyone know how to use the define function and pass a variable into it? Maybe I'm doing this wrong altogether? I have setup some options in WordPress Settings API, and am trying to pass the option value into my plugin.
What am I doing wrong?
define("MAPS_HOST", "maps.google.com");
$options = get_option('plugin_options');
var $gMapKey = $options['map_key'];
define("KEY", $gMapKey);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
var 用于类,您应该使用:
var is meant for classes, you should be using: