admin管理员组

文章数量:1294707

Bit of an awkward one here, and there may not be a solutions within current WP core.

Basically I have a CPT called "connection" with a custom meta field called "outcome" which stores an integer.

I'd like to list the sum of all "outcome" fields on all "connection" posts, by author.

E.g. User 1 has authored 10 "connections", with their combined "outcome" field equalling [int].

I know how to list the number of "connections" authored, with count_user_posts( $user->ID , 'connection' ); but am stuck on the rest.

I've tried doing post queries, but that didn't seem to be the right direction as it lists each individual post whereas I'm needing to combine totals and metadata.

Any thoughts?

本文标签: custom fieldQuery posts by post typeauthor and post meta