Well seems like not many people are digging into BP so here is the solution I found.
To add a new field group using BP hooks:
// Create new Field Group
$group_args = array(
'name' => 'Social Networks'
);
$group_id = xprofile_insert_field_group( $group_args ); // group's ID
To add some fields to this new group:
// Insert New Field
xprofile_insert_field(
array (
field_group_id => $group_id,
name => 'Twitter',
can_delete => false, // Doesn't work *
field_order => 1,
is_required => false,
type => 'textbox'
)
);
I think there is currently a bug in BP. can_delete = 0
means you cannot delete something (ie field or group), but no matter what you pass to xprofile_insert_field()
it is going to be can_delete = 1
.
Related Posts:
- Integrating Buddypress, Wootumblog and WPMU Sitewide tags
- BuddyPress: Allow only one email domain to register
- Ability to set character limit in BuddyPress?
- Syncing BuddyPress and WordPress profile fields [closed]
- Buddypress Full documentation [closed]
- What problems can BuddyPress make? [closed]
- How to force buddypress users to complete profile after registration? [closed]
- How to override Member’s Avatars in BuddyPress [closed]
- Rename Buddypress Profile Tab
- How to re-enable admin bar with Buddypress active? (BP bar removed) [closed]
- Show buddypress notification in the frontend [closed]
- Buddypress and WordPress on different subdomains with the same database?
- BuddyPress Xprofile check if user can view field [closed]
- How to reply to Buddypress notifications? [closed]
- Remove tabs from buddypress groups and members pages [closed]
- Buddypress profile pictures sync across WordPress Multisite Network
- Make Profile link, link to the BuddyPress profile instead of the WordPress dashboard? [closed]
- I’m trying to Add a new Buddypress menu tab and it is not showing up [closed]
- Showing the user’s username in registration email or activation page with BuddyPress [closed]
- BuddyPress: What is the use of is_default_option field in wp_bp_xprofile_fields table? [closed]
- How to get Viewing profile ID in buddypress? [closed]
- delete a photo tag in rtmedia [closed]
- Can’t Find BBPress data in Database
- How to get user id which is done by buddypress [closed]
- BuddyBoss (BuddyPress / bbPress) moderation filters not doing anything
- How to add a count in a custom tab in a Buddypress group
- Table ‘wp_signups’ doesn’t exist [closed]
- Show activities of defined BuddyPress groups [closed]
- How to edit buddypress templates? [closed]
- Add an extra field to BuddyPress activity form
- Buddypress – adding custom post to members
- BuddyPress Toolbar
- how to remove mandatory required fields in buddypress registration [closed]
- User-based media gallery
- Customizing the BuddyPress blog loop
- BuddyPress returning incorrect xprofile date [closed]
- Buddypress dynamic profile field
- Is it possible to remove ‘group’ from slug for buddypress groups
- Using WordPress as an API [closed]
- Display message on homepage when new user account is activated
- How to carry over existing wp users to a new buddypress installation [closed]
- Add excerpt and post thumbnail to Buddypress blog directory page [closed]
- How to create a customized logout URL in BuddyPress
- How can I display the total number of favorites for any particular buddypress activity stream post? [closed]
- BP Profile search results won’t link to user’s profile page [closed]
- Integration of Cubepoints/Achievements
- Capture Webcam Video within Buddypress (and BuddyPress Media) [closed]
- BuddyPress/bbpress: There was an error when creating the topic
- bp_has_members with custom fields [closed]
- Display count of new members registered today [closed]
- WordPress SEO plugin (by Yoast) and BuddyPress [closed]
- security issue in wordpress?
- How can I display a buddypress group name in the header.php so that it shows when viewing each single group? [closed]
- BuddyPress user custom url structure , any one knows filter for bp_core_get_userlink [closed]
- Fill the content of newly added Profile Tab (BuddyPress)
- Include Buddypress & bbPress styles/scripts conditionally [closed]
- Change xprofile visibility options in Buddypress [closed]
- Problems with redirecting a BuddyPress custom subnav item [closed]
- Buddypress – Add activity scope [closed]
- How to: get_user_meta – BuddyPress [closed]
- Where do I edit the user profile with Buddypress? [closed]
- Buddypress Language Files Question [closed]
- how to remove header from registration page? [closed]
- how to find the current page is isngle activity page in buddypress? [closed]
- Customize Activity Stream – Buddypress [closed]
- I’m trying to use the Group Extension API in BuddyPress but keep getting a fatal error [closed]
- BuddyPress user bio in profile [closed]
- Buddypress Group creation step reordering [closed]
- Is it possible to use WP_USER_QUERY to search by username using a wildcard? [closed]
- Displaying the errors from my BuddyPress script
- How to add a new variable to blog creation form?
- BP Profile Search with limited range
- Random 404 errors using Buddypress
- validation email signup form buddypress
- WordPress Buddypress changes groups position
- How to filter members by xprofile field via BuddyPress REST API
- Redirecting non-logged in users trying to view Group pages but not the Group directory
- adding xprofile for this user
- Add usermeta on Buddypress register
- Code correction – Hide a profile from visitors with a specific role
- How to customize BuddyPress Notification triggers?
- Buddypress profile link on author blogroll page
- How to add “create page” option for users in buddypress like facebook?
- how to create buddypress shortcodes?
- Strange issues on sign up form
- How to display profile fields with no data in BuddyPress profile view? [closed]
- How can I place ad code after every 5 activities in BuddyPress activity loop?
- Where am I gaining 6px height retrieving buddypress avatar [closed]
- Send a specific email in HTML and the rest in plain text
- Serve WordPress in root path of Apache
- Buddypress registration page hangs [closed]
- Adding custom HTML to each profile group tab [closed]
- buddypress edit profile [closed]
- WordPress/BuddyPress plugin to allow users to create members-only posts [closed]
- BuddyPress Component Slug 404 [closed]
- Saving Custom Fields Defined in BuddyPress’ register.php
- buddypress bp_core_add_message() doesn’t fire why? [closed]
- How to disable buddypress top mini adminbar [closed]
- Bp-reshare alternative [closed]
- BuddyPress Activity Stream – Remove/Replace […] from blog post excerpts