Get maximum number of attached fields to any post

In a recent project I needed to get the maximum number of attached files to any post. The files were of course added to my posts by using Simple Fields and a repeatable field group.

Since this was the first time I’ve ever needed to do this, there was no built in functions for this.

Anyway, turned out to be pretty straightforward. The solution for me was this: Continue reading