This wouldn’t be possible unless you keep a log of users that have voted the Idea. You will have to create another hidden post_meta array which will store a list of all the users who have voted the Idea. In that way you could count the number of votes an author has given. Or better yet you could create and update the user_meta ‘ideas_voted’ when a particular idea is voted by a user.
if ( idea is voted ) {
$ideas_voted = ( get_user_meta( $curauth->ID, 'ideas_voted' ) ) ? get_user_meta( $curauth->ID, 'ideas_voted' ) + 1 : 1;
update_user_meta( $curauth->ID, 'ideas_voted', $ideas_voted );
}
Related Posts:
- How to get all term meta for a taxonomy – getting term_meta for taxonomy
- Short of raw SQL, can I query for multiple attachment metadata that have a given array key?
- Triple meta_key on custom SELECT query
- Get updated post meta on save_post action?
- Generate an Email address from that of the Post Author
- MySQL Query To Select Post By Postmeta
- Set Condition echo function get_post_meta
- Get a row from a separate table by matching a posts meta_key to a tables ID column
- Compare string with post id in wpdb and do stuff when match is found
- Read post meta values, only if posts are public
- How to test the outcome of a wpdb query?
- How is the author’s name given a different color?
- Get the author meta adds now
- count post meta values
- Conditional For get_the_author_meta
- Randomizing Post Links Outside of Loop – No Author or Date
- How to query and update one colum in postmeta table?
- Display current ranking of post as a number in post title
- get specific values from WordPress meta_value
- Check For get_post_meta on Author Archive Page
- Count Post and Page Views based on meta_value Using Shortcode in Dashboard Widget
- Get data from custom table and update relative post_meta based on meta_key
- How can i set media attachments to the author of the post or page for already existed posts with attachments
- Get table parameter and save in meta value
- Exclude category from DB query
- Fetching array of postmeta with $wpdb and in_array conditional
- Which query method to use? (edit- wpdb syntax problems)
- Cache metadata for set of posts
- Counting number of identical meta keys
- How to get all the related ids without array?
- Check if Post Title exists, Insert post if doesn’t, Add Incremental # to Meta if does
- Meta compare with date (stored as string) not working
- How to update/insert custom field(post meta) data with wordpress REST API?
- Front-end update_post_meta snippet displays white screen?
- How to get meta value in wp_attachment_metadata
- Clean up output added via wp_head()
- User Published Post Count
- get_post_meta returns bool(false)
- How to get custom post type to display post meta on archive pages?
- WP_POSTMETA changes site crash
- meta_post_meta return value 1
- How to use post_id with a Class?
- INSERT ON DUPLICATE KEY UPDATE failes in postmeta table
- Set Checkbox as checked by default
- replacing the_autor or make callback
- Some post meta fields stop saving after a few successful saves
- Save an array of values in the post meta box
- get_post_meta() empty in preview WHEN custom post is published [closed]
- Add Embed.ly API objects to post_meta on update
- Editing does not change post_name
- $wpdb class updating meta_value using Ajax [closed]
- Counting posts with argument without retrieving the posts
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- How to selected which tags to print, instead of printing the whole tag list?
- query posts and split meta information into separate div’s
- Querying Database with wpdb
- add unique string as custom-field to every post
- How do I insert a new meta key / value pair, but only if another meta key is present?
- “Cannot use import statement outside a module” JS error while adding a custom meta block?
- Gutenberg featured image checkbox – checkbox not correctly set on editing page reload
- How to properly use oneOf and anyOf in Rest Schema?
- wordpress is_front_page() issue
- If ACF meta_key has meta_value
- How we can get “get_post_meta” of specific user who added it
- Repeated nav bar queries failing to be cached
- help to decipher wp metadata
- Cant create or update meta fields using WordPress REST API
- Filter posts by meta key
- delete duplicates wp_postmeta
- Post Thumbnail missing when using webp format while sharing
- Bulk Update Post Meta Values from Different Post via Rest Api
- update_post_meta() is not saving the value
- Only show meta on one post type on search results page
- How to register post meta with multi level arrays?
- If I disable screen options, does WP still try to update post meta?
- Can we have duplicate key pair values in post meta data?
- I created a Custom Meta Box but it is not displaying the value on my post page
- Meta data being pulled from wp-login.php
- Get post content before rendering
- How do I get all authors posts of a custom post type outside loop
- wp_insert_post inside save_post adds wrong metadata to inserted post
- Rename image filename using ‘media_handle_upload’
- Update Post metafield of specific categories
- Author.php Page views counter
- Using Self Hosted Video URL With Custom Fields
- Multiple postmeta values to the same post_id/meta_key combination?
- get_post_meta not work in php foreach
- Why are my custom metaboxes not updating the post meta?
- Problem serializing single quote and double quote into post meta
- Storing post_meta fields in array
- Performace on 1 million plus meta fields vs 1 field with 1 million multi array
- Query postmeta values, and return multiple post_titles for common meta value
- Piklist File Upload
- how to echo/display the custom field value in specific custom field name?
- update_post_meta() not working in bulk option
- How to update the ‘modified_time’ of a post ONLY when content is changed?
- Multiple If else statements on Search Result Page
- Adding an orderby filter, casting postmeta with multiple keys
- get_children filter with postmeta
- get_post_meta() returns nothing in save_post, publish_post, wp_after_insert_post