Skip to:
Content
Pages
Categories
Search
Top
Bottom

Question about integrating with BuddyPress registration /register

  • Built a custom registration plugin for a client, only to realize that they have BuddyPress running. My registration hooks aren’t working (haha) mostly because I think BuddyPress has taken over the process. In this plugin, I prompt the user to enter information in about their gender, current country, and most important category of content, then i store all that info in wp_usermeta.

    Would it be best to just trash what I have and use BuddyPress for this information, and if so, will BuddyPress let me do this kind of thing? Or can I just run my stuff by attaching to the appropriate BuddyPress hook instead of register_form (for the register form) and user_register (for adding info to the wp_usermeta table…

    Thanks for your advice on this one.

Viewing 11 replies - 1 through 11 (of 11 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    What are you going to use the extra usermeta for? If you just need an easy way to store and retrieve some data about individual users, then using BP xprofile fields is really the easiest way to go – they can be created in the Dashboard, and all the registration markup & save/retrieve functions are all built in. If, on the other hand, you’ve already built a bunch of custom functions to query across usermeta, then it’s probably best to keep what you’ve got (saving in wp_usermeta) and hook some functions into the BP registration process.

    Yeah, at the moment we are using the answers to these questions to grab content based on their gender, location, and category preferences — we match what they give us to WP categories and any meta-keys in the content we can match.

    Sorry, we display this information on a MY page that only logged-in users can see.

    I would suggest you use the BuddyPress Profile Fields to record this information — you can view the template used on the registration screen at bp-default/registration/register.php. You can then pull the information out of BuddyPress and just feed the variables to your existing “grab content” query.

    See xprofile_get_field_data() in /buddypress/bp-xprofile.php how to retrieve/set this information programatically.

    Will this work if two of our questions are lists of countries/states and the other two are lists of categories? In other words, will buddypress allow me to add data sets like these? And can I still set the data in wp_usermeta table and retrieve it in other uses?

    Also–is it possible to rework look and feel of the registration form itself? Two of our questions involve choosing images along with form elements, didn’t know if this was possible.

    Yes. Have a test install of BuddyPress and look at the “Profile Field Setup” menu item underneath the main “BuddyPress” menu in wp-admin to see what you can do with the profile fields.

    Per my previous post, the registration form is at /bp-default/registration/register.php. Copy that into your (child?) theme, preserving directory structure.

    Okay, sorry for being so thick, I’ve downloaded BuddyPress and see no registration folder.

    The theme lives in /buddypress/bp-themes/bp-default.

    You *could* move out bp-default and put it into /themes/, for example.

    Never mind, I see it now. It’s under bp-themes as the root folder.

    Okay, then, I have this half working. Is there a safe way to update a wp_bp_xprofile_data table then? I see I can pull out a bit of profile data with xprofile_get_field_data(‘field_name’,$userid)….is there one for update? that way I can keep this info synched from within my own plugin as well.

    Yes; as I said up, have a look in /buddypress/bp-xprofile.php. There is a xprofile_set_field_data().

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Question about integrating with BuddyPress registration /register’ is closed to new replies.
Skip to toolbar