This is what I’ve got in the functions.php file.
if ( function_exists( ‘wpas_add_custom_field’ ) ) {
wpas_add_custom_field( ‘my_custom_field’, array( ‘title’ => __( ‘People in Household*’, ‘awesome-support’ ) ) );
}
if ( function_exists( ‘wpas_add_custom_field’ ) ) {
wpas_add_custom_field( ‘my_field_with_options1’, array(
‘title’ => ”,
‘field_type’ => ‘checkbox’,
‘options’ => array( ‘option’ => ‘I am at least 14 years old.*’ ),
‘id’ => ‘check1’
) );
}
if ( function_exists( ‘wpas_add_custom_field’ ) ) {
wpas_add_custom_field( ‘my_field_with_options2’, array( ‘title’ => ”, ‘field_type’ => ‘checkbox’, ‘options’ => array(‘option’ => ‘I live or have a legal issue in Whatcom County, WA.*’ ) ) );
wpas_add_custom_field( ‘my_field_with_options3’, array( ‘title’ => ”, ‘field_type’ => ‘checkbox’, ‘options’ => array( ‘option’ => ‘My legal issue is not one for which I could go to jail.*’) ) );
wpas_add_custom_field( ‘my_field_with_options4’, array( ‘title’ => ”, ‘field_type’ => ‘checkbox’, ‘options’ => array( ‘option’ => ‘I do not already have an attorney helping me with this issue.*’ ) ) );
}
if ( function_exists( ‘wpas_add_custom_field’ ) ) {
wpas_add_custom_field( ‘my_custom_field1’, array(
‘title’ => __( ‘monthly income*’, ‘awesome-support’ ),
‘field_type’ => ‘number’ ,
‘required’ => true
) );
}
In the code you shared, only the field “monthly income*” is set to be required.
If you need other fields to be mandatory, you must set the argument required to true just like for the monthly income field.