Title: Operations before send using custom fields
Last modified: August 24, 2016

---

# Operations before send using custom fields

 *  [Samuele Colombo](https://wordpress.org/support/users/samuele-colombo/)
 * (@samuele-colombo)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/operations-before-send-using-custom-fields/)
 * Hi,
    I try to retrieve a custom data from all posts of a particular type AND (
   this is the most important stuff) to return formatted code.
 * Example: I have 10 posts of type “book”, each book has a meta_key “feedback” 
   and a field “author”. I need to retrieve the AVERAGE of feedbacks of an author.
 * So, my URL could be [http://example.com/wp-json/posts?post_type=book&author=1](http://example.com/wp-json/posts?post_type=book&author=1)
 * I’ve three questions:
    - How can I retrieve data from custom fields?
    - Exists a way to make the average of the feedbacks directly in my PHP code?
    - If I would hide the number of the author (this is the same in WP database…
      not very strong in terms of security) and use another key? can I take custom
      meta_key from user?
 * [https://wordpress.org/plugins/json-rest-api/](https://wordpress.org/plugins/json-rest-api/)

The topic ‘Operations before send using custom fields’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-rest-api_2e3641.svg)
 * [WP REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-rest-api/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Samuele Colombo](https://wordpress.org/support/users/samuele-colombo/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/operations-before-send-using-custom-fields/)
 * Status: not resolved