开发者

Pass variable to define() php

Does anyone know how to use the define function and pa开发者_开发技巧ss 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);


var is meant for classes, you should be using:

$gMapKey = $options['map_key']
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜