As I refine my most popular plugin it will store a special number decoded from the user's birth date, which is an extended BuddyPress field in
bp_xprofile_data. All users get a number between 1 and 260, and I will assemble a list of BuddyPress users based on this number.
It seems there's at least two established methods of storing extended user data with the
usermeta table. There are 4 possible methods I can imagine:
- Use the BuddyPress
- Use the
- Add a field to the
wp_userstable so that I can get
user_idwith the "fastest PHP in the west"
- Create a fresh new table for my awesome plugin
I want code that is efficient with resources of course, as there's gunna be lot's 'o doggies to corral.
Is the recommended method to insert the number into the
usermeta, and retrieve it with a query, something like this?
$users_by_kin = "SELECT * FROM ".$wpdb->prefix."usermeta WHERE meta_key='kin_id' AND meta_value='$kin_id'"
Which method is considered best WP Practices?