-
Notifications
You must be signed in to change notification settings - Fork 1
Email field
Loïc Antignac edited this page May 24, 2022
·
6 revisions
By default, email field only requests the following informations:
[
'slug' => 'company_email',
'type' => 'email',
'labels' => [
'label' => 'company_email_label',
'help' => 'company_email_help',
],
],
The labels
key contains the keys for retrieving the labels from the labels
array at the root of the entity declaration. Eg:
$declarations[] = [
'entity' => 'Webaxones\Core\Option\SettingGroup',
'labels' => [
'company_email_label' => __( 'E-mail address', 'webaxones-content' ),
'company_email_help' => __( 'E-mail address of the company', 'webaxones-content' ),
],
But it is also possible to format the email field with an additional key called args
which takes an array of the optional arguments that an HTML 5 input type email can support.
Example:
[
'slug' => 'company_email',
'type' => 'email',
'labels' => [
'label' => 'company_email_label',
'help' => 'company_email_help',
],
'args' => [
'patterm' => '.+@globex\.com',
'size' => '30',
'required' => true,
],
],