简体   繁体   中英

Buddypress Xprofile Custom Fields Type (Loop user profile field)

I'm trying to create a site where the members can search for each other based on various profile fields like "games", "platform", "skill level" etc.

I want to be able to fetch datas on how many people have different tags on them.

Under the skill level for example i have "beginner", "intermediate" and "hardcore" I wanna grab the number from each so i can pull them out like Beginner: 30 people, intermediate: 199 people etc.

Is this possible? And how?

 global $wpdb;

 $results = $wpdb->query( "SELECT count( `user_id`)  FROM `sf_bp_xprofile_data` WHERE `field_id`= 8 AND `value` = 'woman'" );

change field id and value according for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM