<?php
/**
 * Extend Settings Endpoint
 *
 * @package Nisje
 */

// Add Member Types.
register_rest_field( 'settings', 'member_types', [
	'get_callback' => function( $object ) {
		return nisje_get_setting( 'member_types' );
	},
	'schema'       => [
		'context'     => [ 'view' ],
		'description' => esc_html__( 'Member Types.', 'nisje' ),
		'type'        => 'array',
		'items'       => [
			'type' => 'string',
		],
		'readonly'    => true,
	],
] );
