public function admin_init() { $section = 'default'; add_settings_section($section, __('Hello Kushimoto 設定', 'hello-kushimoto'), array($this, 'section_description'), $this->page_slug); add_settings_field('hello_kushimoto_speaker', __('キャラクター設定', 'hello-kushimoto'), array($this->option_page_view, 'create_select_field'), $this->page_slug, $section, array('name' => 'hello_kushimoto_speaker', 'options' => $this->create_options(), 'current' => $this->option_manager->get_speaker_name())); register_setting($this->option_group, 'hello_kushimoto_speaker'); }
public function test_get_speaker_name() { $option_manager = new Hello_Kushimoto_Option_Manager(); $options = $option_manager->get_speaker_name(); $this->assertTrue(class_exists($options, true)); }
/** * * Factory Method for Speaker. * * @return Hello_Kushimoto_Speaker|void */ public function get_current_speaker() { $speaker_class = $this->option_manager->get_speaker_name(); return apply_filters('hello_kushimoto_speaker', $this->create_speaker($speaker_class)); }