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']
精彩评论