Your code does work. It’s just that you are declaring $xfield_args after you have made the call xprofile_insert_field( $xfield_args );
it should look like this
add_action('bp_init', 'field_xprofile_twitter');
function field_xprofile_twitter()
{
global $bp;
$xfield_args = array (
field_group_id => 1,
name => 'Twitter',
can_delete => false,
field_order => 1,
is_required => false,
type => 'textbox'
);
xprofile_insert_field( $xfield_args );
}
Related Posts:
- Get basic Image Uploader on User Profile Page
- How to display user’s avatar on their profile page?
- Send mail to user only once when specific check box is selected and updated from profile meta updated by admin
- add custom field in user register form
- Prevent update of custom user profile meta field on the front end after 1st entry
- action user_new_form param is a string
- How do I add a dropdown list of numbers 1 – 1000 as an extra profile field?
- How to order custom fields in the user profile (admin area)
- Remove fields from WordPress profile
- How $_GET[‘updated’] variable is passed when updating a user?
- how to save multiple checkbox in usermeta and get it?
- use single form to enter multiple profiles
- user profile replace first name last name with custom values
- How to create a front end user profile with a friendly permalink
- How to get a buddypress user profile link and a certain user profile field for the current post author?
- how to get list of all users and their metadata
- How to make a custom column on the Users admin screen sortable?
- wp_update_user doesn’t update and update_user_meta does
- remove user_meta data from database for all users
- How to get last login Access Date and time
- How to get user metadata for social media url?
- Admin user edit – Grab newly submitted user meta immediately after update/submit
- How do you make the email field on the profile page read only for subscribers?
- wp_get_current_user in custom file returns 0
- How to create user personal pages with information from their meta profile fields?
- Customizing WP tables or adding new ones?
- Are the default entries for a user in wp_usermeta documented?
- Drop down list in user profile page
- update_user_meta adding new rows in db for same key
- Display site admin profile fields in header.php
- Allow role to edit users at lower level with only specific metadata
- User meta conventions / name registry, for social media links
- Get user’s ID on logout
- Sanitize textarea instead of input
- Multiple User-Meta Values in One User-Meta Key
- Gravity Custom Merge Tags [closed]
- Update user meta through a front end form
- What is the difference between get_the_author_meta() and get_user_meta()?
- Can I prevent “wp_user_level” from getting added to wp_usermeta on registration?
- Get the Google+ and Twitter links – WordPress SEO plugin
- Adding current user’s ID to the end of PDF hyperlinks in post content
- Why get_users() not working on the admin backend?
- Can I set user meta for theoretical user 0?
- Is there a way to append meta data without creating a race condition?
- I want to update my user meta table
- Subscribers Group User meta delete
- Frontend Image Upload
- How can I make the user names of commentors clickable links to the user’s profile from the admin comment screen?
- How to position user meta data field
- Get user meta for only the keys with a certain prefix
- Serializing User Role for update_user_meta
- Get user_meta values for a user for an array of meta_keys?
- How to pull user/author profile data in a plugin?
- Fetch user related data
- add_user_meta allows multiple clicks and inserts more than 1 value
- Add user meta fields on creating the user
- Order By Meta_key but convert custom date to Y-m-d first
- editing usermeta when field is an array
- Solving a get_user_meta() problem in Multisite
- How to order users by a date in the meta_value array
- If logged in user views his profile page
- Should I have a single cron job that loops the users, or one for each user?
- Updating user meta on save post
- Save editor’s value in user meta and retrieve it
- How to get its meta_value of a specific meta_key within wp_usermeta
- Exclude specific user_id from args in get_comments
- How do I sort a WP_USER_QUERY by multiple meta fields?
- WP_Editor not saving data in user_meta
- SImple Example To Update User Info From Front End [duplicate]
- Display Country Flag in Profile WordPress/Buddypress
- Get user edit functions in frontend for site admin
- How do I update user email from frontend input field?
- How to get metadata (in my case mail) of users who have a certain set of metadata?
- user metadata in json format, update the data partly only
- check metadata in wordpress
- How can I return an error message when updating user meta?
- Adding user metadata to all users
- How can i add user display name drop down menu in frontend?
- Get user count based on multiple meta key values?
- Existing user_meta fields not updated
- get_the_author_meta i want to write in a loop
- How can I track who clicked what in my member area?
- How to gets users EMAIL by their USERNAME
- Get user meta on registration hook
- Storing data to database and user registration
- add_user_meta() vs update_user_meta()
- Get all data form users and users metakey
- How to get user meta value in wordpress
- How to display checkbox meta array values one by one?
- Fetch User Meta Data
- How to toggle delete/update user meta values?
- Multisite – Echo admins profile meta
- Reordering fields in registration form via custom plugin
- Validate user meta and redirect
- Multidimensional array problem with update_post_meta [duplicate]
- How ‘secure’ are loops?
- CRM and newsletter integration? [closed]
- Strip Twitter Username from Profile Field with URL and Save to New Profile Field
- Custom user meta values in shortcode
- Update another users meta