3
変数をadd_settings_section()コールバックに渡す方法は?
プラグインの各設定に対して、設定API関数呼び出しを可能な限り自動化しようとしています。オプション配列をループし、出力し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_' . …