Settings', ) ); } public static function settings_page() { if ( empty( $_GET['tab'] ) ) { $tab = 'general'; } else { $tab = sanitize_key( $_GET['tab'] ); } /* submenu_options = { tab => {name => '' active => true|false} } */ // todo generate this somehow // maybe with filters, similar as with the settings $submenu_options = array( 'general' => array( 'name' => 'General', 'active' => false ), 'events_manager' => array( 'name' => 'Events Manager', 'active' => false, ), 'gatherpress' => array( 'name' => 'Gatherpress', 'active' => false, ), 'the_events_calendar' => array( 'name' => 'The Events Calendar', 'active' => false, ), 'vsel' => array( 'name' => 'VS Event', 'active' => false, ), ); $submenu_options[$tab]['active'] = true; $args = array( 'slug' => settings_slug, 'options' => $submenu_options, ); switch ( $tab ) { case 'general': \load_template( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . 'templates/settings-general.php' , true, $args ); break; default: \load_template( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . 'templates/settings-extractor.php', true, $args ); break; } } }