[section => string, label => string, type => string, ...]` * * @return array */ abstract protected function define_options(): array; /** * Title and id of the settings tab. * * @return string[] section_id => title */ abstract public function get_sections(): array; /** * Whether the tab has a submitable form. * * @return bool */ public function has_form(): bool { return true; } /** * Get all options for this tab. * * @return array */ public function get_options(): array { $options = $this->define_options(); /** * Filters the options for a specific settings tab. * The dynamic portion of the hook name, `$this->get_id()`, refers to the tab's ID (e.g., 'general'). * * @param array $options The array of option definitions for the tab. * @param self $this The instance of the current tab class. */ return apply_filters( "adpresso_settings_tab_{$this->get_id()}_options", $options, $this ); } /** * Renders the settings tab. * * @param bool $needs_submit * * @return void */ public function render( bool $needs_submit = true ): void { do_action( 'adpresso/settings/page/' . $this->get_id() . '/before', $this ); echo '