我在主题检查器中收到了一堆关于设置api init函数的通知。这些通知都是针对$\\u请求数组中的“未定义索引”的。代码如下:
<?php
function typesetter_settings_api_init () {
if ($_REQUEST[\'update-settings\']) {
typesetter_save_settings();
}
register_sections();
$current = $_REQUEST[\'tab\'] ? $_REQUEST[\'tab\'] : \'page\';
$page = \'typesetter_options_\'.$current;
$callback = \'typesetter_render_settings_field\';
foreach ( typesetter_get_sections() as $section ) {
foreach ( typesetter_get_settings_fields($section) as $field ) {
add_settings_field(
$field[\'id\'], // $id
$field[\'title\'], // $title
$callback, // $callback
$page, // $page
$field[\'section\'], // $section
array(
\'id\' => $field[\'id\'],
\'type\' => $field[\'type\'],
\'choices\' => $field[\'choices\'],
\'desc\' => $field[\'desc\'],
\'class\' => $field[\'class\'],
\'std\' => $field[\'std\']
)
);
// Register my setting so that $_POST handling is done
register_setting($page, $field[\'id\']);
}
}
}// typesetter_settings_api_init()
?>
我将其挂接到“admin init”中。我是在做傻事吗?我要把它挂在别的地方吗?我应该无视这些通知吗?