Add fields to wp_users
If I add fields to the wp_users table in the database, how can I add those fields to the registration form?
I know Buddypress has a way to add profile fields, but they get stored in weird places. I want one table with all the basic members data -> full name, company, city, URL, etc.
This is just not the way that WordPress MU works. Buddypress is a plugin for WordPress MU and therefore uses the standard functions that WPMU provides to store and retrieve custom database information.
I know that’s not default WordPress MU+Buddypress. That’s why I ask, in the ‘Creating & Extending’ section. I understand it would require hacking.
It’s not impossible to add fields to the wp_users table. My question then is, where can I add corresponding fields to the form and where is the query that puts the data in the fields.
That’s should be hackable somehow. Don’t tell me there are Natural Laws against it.
If there’s really no way to achieve this kind of thing, I can’t use WPMU/Buddypress and should get out now while I still can.
That is exactly what usermeta is for. You should take a look at the WordPress codex for this sort of thing, it will help you a great deal.
That is exactly what usermeta is for.
usermeta contains a lot of very cryptic data about bb_capabilities and blog roles/functionality, most from test members I’ve already deleted from the system. What am I supposed to do with that?!
The WordPress Codex has lots of useful information, but very little about the database structure, how to form queries to pull up that data and where these queries are in the WordPress code.
There is a section on the database structure, but it\’s about version 2.5. I know some fundamental changes were made since that version. It’s not relevant for WPMU and Buddypress anyway.
Basically I’m trying to figure out how to keep a full-fledged members database at the heart of WordPress, with common fields like name, address, company, title, etc., that I can tap into for other scripts. Static data that doesn’t interfere with other functionality in WP.
Has nobody ever done that? Is it impossible?
Should I create a seperate members database outside WordPress that somehow communicates/syncs with WordPress?
I realize that you are not getting the answers you desire. You must have a sufficient understanding of and comfort level with PHP before you can delve too deeply into hacking your own solutions or coding your own theme templates. Otherwise, you need to use the stock WPMU and BuddyPress install and then customize with any plugins and 3rd-party themes that may be useful.
Since we do not have any idea of your particular coding skills, we are trying to point you in the right direction. Please realize that beyond a certain point, we cannot help you write your own custom code.
We all started at the beginning when it came to coding and then had another learning curve when it came to understanding the inner workings of WordPress and BuddyPress. It can be frustrating along the way but it is indeed possible to accomplish!
Here are a few more tips:
- Since you do seem to be wanting to group all user data within stock WP tables, you should search the WP and WPMU forums and ask your questions there
- Visit these WP Codex pages to help shed more light:
- Google for tips on learning data-driven PHP coding
- Hire a 3rd-party developer who can do the work: hacking files directly or create a plugin that will accomplish what you’re after
Please hang in there and don’t give up hope.
Thanks Jeff. Those function reference pages look very useful. I’ll dive back into PHP hell next Saturday…
The more mature packages, like WordPress, are great for teens/tweens that want to add widgets and play around with templates, but they drop the ball on some basic grown-up business requirements and are much harder to customize unless you\’re a hardcore programmer.
I can’t afford to spend the time to become a programmer. I’d hire a 3rd party developer if I could get a clearer picture of what I need and what’s possible in WP. I did do Google searches and have posted lots of related questions on the WP and WPMU forums.
BTW, an intern from NYU Polytechnic was supposed to work on my project. He was a real PHP programmer, but had never heard of WordPress and seemed to know even less than I did.
I have related questions about the relationship between the WP tables and the BP tables, so I’d like to make sure that I understand the responses above.
I know that BP maintains user profile information separately from “wp_usermeta” (in “wp_bp_xprofile_data”, to be specific). BP provides functionality for modifying this information, but no way for putting “wp_usermeta” fields into the “edit profile” form.
So I think the answer to Peter’s question is that without *major* customization:
1. You have to be happy with user data being stored in a few different places
2. All user editable info must be in the tables created by BP
Is this correct?
BTW, what does the “Disable BuddyPress to WordPress profile syncing?” option do under BP General Settings in the admin page? Does this only apply to the username field?
- The topic ‘Add fields to wp_users’ is closed to new replies.