I found an error with the formatting of editors' names. Editors, in APA 6th edn when they are listed for a book in the format below have the name order F. Last-name
. The current template has this backwards as Last-name F.
Haybron, D. M. (2008). Philosophy and the science of subjective well-being. In M. Eid & R. J. Larsen (Eds.), The science of subjective well-being (pp. 17-43). New York, NY: Guilford Press.
However, there is a slight complication with the the way the template is currently set up because, editors when they take the place of the author (the whole book is referenced) are presented just like authors, such as in the example below:
Koch, S. (Ed.). (1959-1963). Psychology: A study of science (Vols. 1-6). New York, NY: McGraw-Hill.
{{/* BEGIN editor */}}
{{- define "editorPart" }}
{{- $editors := .editor }}
{{- if $editors -}}
{{- $totalEditors := len $editors -}}
{{- range $editorIndex, $editor := $editors -}}
<span itemprop="editor" itemscope itemtype="https://schema.org/Person">
{{- with $editor.given -}} 
<meta itemprop="givenName" content="{{ . }}" />
{{ substr . 0 1 }}. 
{{- end -}}{{/* First letter (initial). */}}
{{- with $editor.secondInitial -}}
<meta itemprop="additionalName" content="{{ . }}" />
{{- substr . 0 1 -}}. {{- end -}}
{{- with $editor.family -}}
<span itemprop="familyName">{{ . }}</span>
{{- end -}}
</span>
{{- if and (gt $totalEditors 1) (lt (add $editorIndex 2) $totalEditors) -}}, 
{{ end -}}
{{ if eq $totalEditors (add $editorIndex 2) -}} & {{ end -}}{{/* Last name has ampersand */}}
{{- end -}}
{{- end -}}
{{- end -}}{{/* END editor */}}