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.