all(); // For now return only as "options" return [ 'data' => $forms->map(function ( Form_Snapshot $form ) { return [ 'label' => $form->get_label(), 'value' => $form->get_key(), ]; })->values(), 'meta' => [], ]; } public function register_endpoints() { // } protected function register_internal_endpoints() { // Register as internal to remove the default endpoint generated by the base controller. $this->register_endpoint( Endpoints\Forms_Index::class ); } public function get_permission_callback( $request ) { return current_user_can( 'manage_options' ); } }