3
如何将变量传递给add_settings_section()回调?
我正在尝试尽可能自动地执行插件中每个设置的Settings API函数调用。循环遍历options数组,然后输出add_settings_section()和add_settings_field()很简单: add_settings_section(): $oenology_hooks_tabs = oenology_hooks_get_settings_page_tabs(); foreach ( $oenology_hooks_tabs as $tab ) { $tabname = $tab['name']; $tabtitle = $tab['title']; $tabsections = $tab['sections']; foreach ( $tabsections as $section ) { $sectionname = $section['name']; $sectiontitle = $section['title']; $sectiondescription = $section['description']; // Add settings section add_settings_section( 'oenology_hooks_' . $sectionname . '_section', $sectiontitle, 'oenology_hooks_' …