custom xprofile field with options
I’m trying to create a plugin that adds an xprofile field to allow admin to choose a custom taxonomy to use as a profile field. I’ve cribbed from the BuddyPress XProfile Image Field plugin by Alex Githatu and some of the class from the datefield xprofile class.
I have the category open up the form for options and have a select populated by relavant values inthe xprofile fields admin screen.
But when submiting that, validation fails with “These field options are invalid.”
(The field is a select :
<select name="field-settings[taxsel]" id ="taxsel-value" class="taxsel-value" >)
I can’t seem to find or make sense of any documentation on how to have buddypress accept my field type option.
Wordpress is 4.9.5, BuddyPress 2.9.4
Any advice or pointers would be very much appreciated.
I’m not sure what of my code to post, in the main plugin file I have
add_filter( 'bp_xprofile_get_field_types', array( $this, 'bpxp_taxsel_field_add_field_type') );
and in that function:
$taxsel_field_type = array(BP_XProfile_TaxSel_Field::FIELD_TYPE_NAME => 'BP_XProfile_Field_Type_TaxSel');
and I see the field tupe if I dump the $field_types after the array merge there.
Thanks in advance
- You must be logged in to reply to this topic.