function to put metadata post in array