开发者

Pass variable to define() php

开发者 https://www.devze.com 2023-03-06 15:22 出处:网络
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 t

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

精彩评论

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

关注公众号