Skip to main content

8.4 Developer Reference

Developer Reference

Beaver Profile Builder exposes two WordPress filters for extending the Profile Edit Form. Add the code to a child theme's functions.php or a small custom plugin.

bpb_custom_field_types

Controls which input types appear in the Custom Field Types dropdown of a Custom field. By default only Text is enabled.

add_filter( 'bpb_custom_field_types', function( $types ) {
$types['datepicker'] = __( 'Date Picker' );
$types['select'] = __( 'Select' );
$types['checkbox'] = __( 'Checkbox' );
return $types;
} );

Accepted type keys: text, checkbox, multicheck, datepicker, timepicker, select, radio, email, url, tel, number, datetime, datetime-local, date, month, time, week.

Types with dedicated options (date and time formats, option lists, column layouts) show those options in the field settings once enabled. See Built-in Form Fields.

profile_edit_form_fields

Filters the field library that the Profile Edit Form's field picker offers. Use it to add a pre-configured field so site builders can pick it by name instead of configuring a Custom field by meta key.

add_filter( 'profile_edit_form_fields', function( $fields ) {
$fields['phone_number'] = [
'type' => 'text',
'label' => __( 'Phone number' ),
'placeholder' => __( 'Phone number' ),
'id' => 'phone_number',
];
return $fields;
}, 20 );

Use a priority above 10 so your additions run after the plugin registers its built-in fields. Field keys without a userprofile_ prefix are treated as user meta keys when saving.

info

The plugin registers its built-in field library through this same filter on init, priority 10.