The xProfile abilities manage a site’s profile field groups and fields. Fields are per site on LocalHero (lh-buddypress-multi-network keeps the xProfile tables per site), so pass site_id to work on another site’s fields. All of them need bp_moderate; the writes default to a dry run.
BuddyPress field types only describe their settings as admin HTML. A type’s settings schema comes from its own get_settings_schema() when it has one (the proposed core change), otherwise from this plugin’s map, which covers datebox, wp-textbox and checkbox_acceptance. Types that save no settings get an empty schema; anything else is unknown, and its settings cannot be read or set here. settings_schema_source says which applies.
admin_save_settings(), in the shape the admin form posts. datebox relative years are signed (negative is in the past) and converted to BuddyPress’s years plus past or future. checkbox_acceptance only reads $_POST, so its page is written to field meta as it would write it.BuddyPress deletes every option of a field whenever the field is saved and re-creates them from the admin form. These abilities supply the options through BuddyPress’s xprofile_field_options_before_save and xprofile_field_default_before_save filters, so a rename keeps them. Option IDs still change on every save; members’ answers are kept, since they store the option name, which is why option names must be unique.
site_id this usually means the type comes from that site’s own plugins; use that site’s connector.New fields go at the end of their group. reorder-xprofile-fields takes every field in a group, plus any to move in from another group, and gives each an explicit position, so fields that share a position (and come back in an unstable order) are separated.
lh_mcp_buddypress_actions_xprofile_settings_schemas ( $schemas ): add a JSON schema, keyed by field type, for a type with settings that does not describe them itself. Each property is read from the type’s get_field_settings() if it has one, otherwise from field meta of the same name.xprofile_fields_saved_field is deliberately not fired. Plugins hook it to save their own admin form inputs from $_POST, and some delete what they stored when the input is missing (lh-profile-page’s gender default, for one). The field cache it clears is cleared directly. Settings other plugins add to the Profile Fields screen are therefore left untouched.