对于任何想要实现同样目标的人:
add_filter( ot_settings_id() . \'_args\', \'my_ot_setting\');
function my_ot_setting($custom_settings){
//do some work with the settings and the sections, ie append your settings.
return $custom_settings;
}
如果父主题在保存选项之前应用此过滤器,则此操作有效,如以下示例所示:
https://github.com/valendesigns/option-tree-theme/blob/master/inc/theme-options.php#L833否则你必须像上面的例子那样自己做。