Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add special custom field into the profile?

  • @johnnypea

    Participant

    I would like to add dynamically generated checboxes (I don’t want they be a static values which can I set in the admin but I would like to collect data with my own php functions). Is there any action or filter to add custom fields and save them? It is possible to create custom field type (which will include functions and data which I need and I will be able to simple add it or remove from the profile through the “Profile Field Setup”) through some filter or action? I was looking for solution how can I add custom fields with coding for quiet long time but I didn’t find anything useful. Thank you very much for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @boonebgorges

    Keymaster

    Without a lot of custom coding, I don’t think you’re going to be able to make this work with xprofile fields. Those fields can only store data when they have been defined in the wp_bp_xprofile_fields table, but if they’re dynamically generated, that’ll be hard to do. It might be more straightforward to save the data as usermeta.

    I guess I’m assuming that you want to save the field data in the bp database tables. Or are you just hoping to display the checkboxes on the profile page, and have them handled by another script?

    In either case, as long as you can add fields to the profile page (which you could do either by hardcoding or hooking to the edit screen at bp_after_profile_field_content), you should be able to grab the $_POST data after xprofile edits are saved (at xprofile_screen_edit_profile) and then do whatever you want with it.

    @johnnypea

    Participant

    I was hoping I could add fields(as I can to standard WP profiles through edit_user_profile/show_user_profile hook) and store the values to the bb xprofile tables without modifying the core files.

    Could you suggest the way how can I add the usermeta fields into bb profile Public and Edit pages and store the values to the standard usermeta table when I hit “Save Changes” button?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add special custom field into the profile?’ is closed to new replies.
Skip to toolbar