• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Wordpress

Wordpress World

  • Submit
  • Disclaimers
  • About
  • DMCA
  • Privacy Policy
  • Contact

You are here: Home / Get user count based on multiple meta key values?

Get user count based on multiple meta key values?

September 27, 2019 by wordpress.stackexchange.com

I am trying to count all of the users meeting multiple criteria. I have tried so many different things and cannot get it to work. Any help is much appreciated. Thank you. add_shortcode(‘pbe_storecount’, ‘pbe_shopcounts’); function pbe_shopcounts($atts) { $atts = shortcode_atts( array( ‘state’ => ”, ‘metakey’ => ‘Group’, ‘metavalue’ => do_shortcode(‘[display_name]’), ‘userrole’ => ”, ), $atts ); $getQuarter = do_shortcode(‘[usermeta key=”current_quarter” user=”717″]’); if ($getQuarter == ‘1’){ $currentQuarter = ‘ranker_q1’; } elseif ($getQuarter == ‘2’){ $currentQuarter = ‘ranker_q1_89’; } elseif ($getQuarter == ‘3’){ $currentQuarter = ‘ranker_q1_90’; } elseif ($getQuarter == ‘4’){ $currentQuarter = ‘ranker_q1_91’; } else { $currentQuarter = ”; } $user_ids = get_users( $args ); $args = array ( ‘role__in’ => wp_parse_list( $atts[‘userrole’] ), ‘fields’ => ‘ID’, // retrieve just the IDs ‘count_total’ => false, // no need for FOUND_ROWS() ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘meta_key’ => $atts[‘metakey’], ‘meta_value’ => $atts[‘metavalue’], ‘meta_compare’ => ‘=’, ), array( ‘meta_key’ => $currentQuarter, ‘meta_value’ => ‘High’, ‘meta_compare’ => ‘=’, ), ) ); return ‘There are <strong>’ . count( $user_ids ) . ‘ High Performers</strong> for ‘ . $atts[‘metavalue’] . ‘ in ‘ . $atts[‘state’] . ‘;}


  • Signal, Telegram grab 40 lakh new users in India amid row over WhatsApp privacy policy
  • 'Every week counts' as Austria, Greece, Denmark seek quick EU OK for AstraZeneca vaccine: Sebastian Kurz
  • Apple pulls the plug on user-found method to sideload iOS apps on Mac
  • NIA postpones examination of two key members of Khalsa Aid indefinitely
  • Prince Charles and Camilla lose key staff member after five years
  • Construction manager, 31, makes $1.4million in TWO MONTHS during lockdown after quitting his job to start an activewear line - and the success comes down to one key design feature
  • How Close Did We Get to an Election Coup?
  • How is Telegram different from WhatsApp?
  • Facebook's Instagram takes on TikTok with short-form video feature Reels
  • Top House Democrat Jim Clyburn warns there are NOT 17 Senate Republicans willing to convict Donald Trump so far - but says more evidence of what happened in Capitol could change their minds
Get user count based on multiple meta key values? have 330 words, post on wordpress.stackexchange.com at September 27, 2019. This is cached page on Wordpress. If you want remove this page, please contact us.

Filed Under: Tags wp_update_post meta key, preg_match_all key value, get_categories order by meta key, update_post_meta multiple values, update post meta key, update_post_meta old value, update_post_meta return value, sequential user-based recurrent neural network recommendations, dbdelta multiple primary key defined, consul key value, key value c#, count on multiple columns sql, how key value, charting multiple texts the value of life, 4chan user count, query key value attention, qgis categorized style multiple values, sum row values based on column headers, counting atoms practice answer key, swagger key value pair, tuples key value store, tuples keys values, angular 4 emit multiple values, vats key values, pivot table count unique values excel 2010, tableau parameter multiple value list, amsco multiple choice answer key 2016, value based reimbursement health care, value base pricing, value based price

Primary Sidebar

RSS Recent Stories

  • Remove unwanted elements for a wp_nav_menu
  • Get_term_meta() always returns false
  • How to ask WordPress to generate XHTML?
  • Get user count based on multiple meta key values?
  • 21 Best Coffee Shop Themes for WordPress (2019)

Sponsored Links

  • Today’s Kathie Lee Gifford says in new book she lost virginity on wedding night to first husband in ‘sexless marriage’
  • Fast & Furious co-stars Dwayne The Rock Johnson and Tyrese Gibson end years-long feud after ‘talking for four hours’
  • I’m A Celebrity star Giovanna Fletcher’s son, 2, falls asleep holding a picture of her in camp in heartbreaking moment
  • Do not resuscitate orders might have been put in place without consent, watchdog says
  • ‘Singing and dancing to their deaths’: football’s forgotten tragedy
Copyright © 2021 Wordpress. Power by Wordpress.