这是我的代码:
$array_theme_options = array(
array(
\'id\' => \'facebook_url\',
\'title\' => \'Facebook Profile Url\',
\'callback\' => \'display_facebook_element\',
\'page\' => \'theme-options\',
\'type\' => \'text\'
)
);
function input_type($id, $type)
{
switch ($type) {
case \'text\':
$input = \'<input type="text" name="\' . $id . \'" id="facebook_url" value="\' . get_option($id) . \'" />\';
break;
case \'checkbox\':
$input = \'<input type="checkbox" name="\' . $id . \'" value="1" \'.checked(1, get_option($id), true). \' />\';
break;
}
return $input;
}
function display_theme_panel_fields()
{
global $array_theme_options;
add_settings_section("section", "All Settings", null, "theme-options");
foreach ($array_theme_options as $ato) {
$cf = create_function(\'$id, $type\',\'return input_type($id, $type);\');
$input_type = $cf($ato[\'id\'], $ato[\'type\']);
add_settings_field($ato[\'id\'], $ato[\'title\'], $input_type, $ato[\'page\'], "section");
register_setting("section", $ato[\'id\']);
}
}
add_action("admin_init", "display_theme_panel_fields");
我在输入时得到这个错误