Yes.
Start by taking a look at :
function xprofile_insert_field() in bp-xprofile\bp-xprofile-functions.php
Thanks for passing the info 🙂
I used the following code, and it’s not doing the job:
function field_xprofile_twitter()
{
$group_args = array(
'name' => 'Social Networks'
);
$group_id = xprofile_insert_field_group( $group_args ); // group's ID
xprofile_insert_field(
array (
field_group_id => $group_id,
name => 'Twitter',
can_delete => false,
field_order => 1,
is_required => false,
type => 'textbox'
)
);
}
Hope you can help 🙂
Are you sure group_id is being set?
Take another look at :
function xprofile_insert_field() in bp-xprofile\bp-xprofile-functions.php
Try passing an array to $args for xprofile_insert_field
Like you did with xprofile_insert_field_group
$args = your array;
xprofile_insert_field( $args );
This isn’t doing the job either:
function field_xprofile_twitter()
{
$group_args = array(
'name' => 'Social Networks'
);
$group_id = xprofile_insert_field_group( $group_args ); // group's ID
xprofile_insert_field( $xfield_args );
$xfield_args = array (
field_group_id => $group_id,
name => 'Twitter',
can_delete => false,
field_order => 1,
is_required => false,
type => 'textbox'
);
}