'string', 'description' => \__( 'Define your own custom post template', 'activitypub' ), 'show_in_rest' => true, 'default' => 'MEETING', ) ); \register_setting( 'activitypub-event-extensions', 'activitypub_event_extensions_event_category_mappings', array( 'type' => 'array', 'description' => \__( 'Define your own custom post template', 'activitypub' ), 'default' => array(), 'sanitize_callback' => function ( $event_category_mappings ) { $allowed_mappings = Event::DEFAULT_EVENT_CATEGORIES; foreach ( $event_category_mappings as $key => $value ) { if ( ! in_array( $value, $allowed_mappings, true ) ) { unset( $event_category_mappings[ $key ] ); } } return $event_category_mappings; }, ) ); } }