We relate a one-parametric generating function for the squares of Legendre polynomials to an arithmetic hypergeometric series whose parametrisation by a level 7 modular function was recently given by Cooper. By using this modular parametrisation we resolve a subfamily of identities involving $1/ \pi $ which was experimentally observed by Sun.