Merge branch 'develop'
Check posts is an array before attempting to use array functions.