public function register_contributor_sections($sections) { $sections['social'] = ['title' => __('Social', 'podlove'), 'fields' => ['services_form_table' => ['field_type' => 'callback', 'field_options' => ['nolabel' => true, 'callback' => function () { if (isset($_GET['contributor'])) { $services = \Podlove\Modules\Social\Model\ContributorService::find_by_contributor_id_and_category($_GET['contributor'], 'social'); } else { $services = []; } \Podlove\Modules\Social\Social::services_form_table($services, 'podlove_contributor[services]', 'social'); }]]]]; $sections['donation'] = ['title' => __('Donation', 'podlove'), 'fields' => ['services_form_table' => ['field_type' => 'callback', 'field_options' => ['nolabel' => true, 'callback' => function () { if (isset($_GET['contributor'])) { $services = \Podlove\Modules\Social\Model\ContributorService::find_by_contributor_id_and_category($_GET['contributor'], 'donation'); } else { $services = []; } \Podlove\Modules\Social\Social::services_form_table($services, 'podlove_contributor[donations]', 'donation'); }]]]]; return $sections; }
public static function podcast_form_extension_form() { $services = \Podlove\Modules\Social\Model\ShowService::find_by_category(); \Podlove\Modules\Social\Social::services_form_table($services, 'podlove_podcast[services]'); }