Title: echo custom fields into array
Last modified: August 21, 2016

---

# echo custom fields into array

 *  Resolved [jduffell](https://wordpress.org/support/users/jduffell/)
 * (@jduffell)
 * [12 years ago](https://wordpress.org/support/topic/echo-custom-fields-into-array/)
 * Hi I have the custom post type ratings, which has been set to allow users to 
   leave feedback, with this is the option of a 1-5 star rating.
 * I’m trying to echo all the custom field values of “rating_star” into an array
   in order to get the average based on post count, is there are simple way of getting
   the total based on all submitted rating values? or am I going about this the 
   wrong way?
 * Cheers

Viewing 1 replies (of 1 total)

 *  Thread Starter [jduffell](https://wordpress.org/support/users/jduffell/)
 * (@jduffell)
 * [12 years ago](https://wordpress.org/support/topic/echo-custom-fields-into-array/#post-4953966)
 * array_sum sorted me out with a DB query

Viewing 1 replies (of 1 total)

The topic ‘echo custom fields into array’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [jduffell](https://wordpress.org/support/users/jduffell/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/echo-custom-fields-into-array/#post-4953966)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
