# Add New Field
Elementor Pro AdvancedThe Form widget has built-in field types, but it also accepts new fields registered by external developers.
# Registering Fields
To register new fields just initiate the field class:
function register_new_form_fields( $form_fields_registrar ) {
require_once( __DIR__ . '/forms/fields/field-1.php' );
require_once( __DIR__ . '/forms/fields/field-2.php' );
$form_fields_registrar->register( new \Field_1() );
$form_fields_registrar->register( new \Field_2() );
}
add_action( 'elementor_pro/forms/fields/register', 'register_new_form_fields' );
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
This hooks to the elementor_pro/forms/fields/register
action hook which holds the form registrar manager. The manager then registers the new fields by passing the field instances.