Adding custom fields to Carrier form
To add new fields to Carrier form you need to hook into the notification/carrier/registered action.
1
add_action( 'notification/carrier/registered', function( $carrier ) {
2
​
3
if ( 'email' === $carrier->get_slug() ) {
4
return;
5
}
6
​
7
$carrier->add_form_field( new BracketSpace\Notification\Defaults\Field\InputField( array(
8
'label' => __( 'Example Field' ),
9
'name' => 'example',
10
'resolvable' => true,
11
) ) );
12
​
13
} );
Copied!
All the field data will be automatically stored and available in $carrier->data property in send() method.
Last modified 1yr ago
Copy link