title */ public function get_sections(): array { return [ 'ads_txt_main' => [ 'title' => __( 'ads.txt settings.', 'adpresso' ), 'description' => __( 'You can manage your ads.txt handling here.', 'adpresso' ), 'controlled_by' => '', 'initially_open' => true, ] ]; } /** * All ads.txt settings. * * Muss als `key => [section => string, label => string, type => string, ...]` aufgebaut sein. * * @return array */ protected function define_options(): array { $options = []; $options['enable_module_' . $this->get_id()] = [ 'section' => 'ads_txt_main', 'label' => __( 'Enable ads.txt module', 'adpresso' ), 'type' => 'checkbox', 'default' => 0, 'sanitize_type' => 'uint', 'description' => __( 'Enables the handling of the ads.txt file.', 'adpresso' ), ]; if ( ModuleManager::is_active( 'ads_txt' ) ) { $options['ads_txt_source'] = [ 'section' => 'ads_txt_main', 'label' => __( 'ads.txt source', 'adpresso' ), 'type' => 'radio', 'default' => 'virtual', 'options' => [ 'physical' => __( 'Use physical file in the root', 'adpresso' ), 'virtual' => __( 'Use virtual file through AdPresso', 'adpresso' ), 'external' => __( 'Use file from external URL', 'adpresso' ), ], ]; $options['ads_txt_custom_lines'] = [ 'section' => 'ads_txt_main', 'label' => __( 'Entries', 'adpresso' ), 'type' => 'textarea', 'description' => __( 'Add ene entry per line', 'adpresso' ), 'depends_on' => [ [ 'field_id' => 'ads_txt_source', 'operator' => 'is', 'value' => 'virtual', ], ], ]; $options['ads_txt_external_url'] = [ 'type' => 'text', 'section' => 'ads_txt_main', 'label' => __( 'External URL', 'adpresso' ), 'description' => __( 'External source for your ads.txt. Needs to be a complete URL.', 'adpresso' ), 'default' => '', 'depends_on' => [ [ 'field_id' => 'ads_txt_source', 'operator' => 'is', 'value' => 'external', ], ], ]; } return $options; } }