I have a custom post type in WordPress called: ‘holiday’ which within that i have a ACF user field and ACF number field. At the moment, when a user submits a holiday request it creates a new holiday post and assigns their user id to user field. The administrator then can approve the post in admin and enter the amount of hours used in the number field.

What im looking to get the total hours added up for all posts for each user. So to query all posts by the ACF user field so i only get the posts for that user, and then to get the value of each of the number fields and add them up?

Read more here: Calculating the total of a custom field from posts


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: